You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.8 KiB
61 lines
1.8 KiB
package com.fr.solution.plugin.better.sql.editor; |
|
|
|
import com.fr.design.data.datapane.sqlpane.SQLEditPane; |
|
import com.fr.design.dialog.BasicPane; |
|
import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; |
|
import com.fr.general.Inter; |
|
import com.fr.plugin.ExtraClassManager; |
|
import com.fr.stable.fun.FunctionHelper; |
|
import com.fr.stable.fun.FunctionProcessor; |
|
import com.fr.stable.fun.impl.AbstractFunctionProcessor; |
|
|
|
import java.awt.*; |
|
|
|
/** |
|
* @author richie |
|
* @date 2015-06-04 |
|
* @since 8.0 |
|
*/ |
|
public class FullScreenSQLPane extends BasicPane { |
|
|
|
private static final FunctionProcessor SQL = new AbstractFunctionProcessor() { |
|
@Override |
|
public int getId() { |
|
return FunctionHelper.generateFunctionID(BetterConstants.PLUGIN_ID); |
|
} |
|
|
|
public String getLocaleKey() { |
|
return Inter.getLocText("Plugin-Better_SQL_Editor"); |
|
} |
|
|
|
@Override |
|
public String toString() { |
|
return Inter.getLocText("Plugin-Better_SQL_Editor"); |
|
} |
|
}; |
|
|
|
private SQLEditPane sqlTextPane; |
|
|
|
public FullScreenSQLPane(String text) { |
|
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); |
|
if (processor != null) { |
|
processor.recordFunction(SQL); |
|
} |
|
setLayout(new BorderLayout()); |
|
sqlTextPane = new SQLEditPane(); |
|
sqlTextPane.setText(text); |
|
RTextScrollPane sqlTextScrollPane = new RTextScrollPane(sqlTextPane); |
|
sqlTextScrollPane.setLineNumbersEnabled(true); |
|
|
|
add(sqlTextScrollPane, BorderLayout.CENTER); |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return Inter.getLocText("Plugin-Better_SQL_Editor"); |
|
} |
|
|
|
public String getText() { |
|
return sqlTextPane.getText(); |
|
} |
|
} |