本文整理匯總了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java RSyntaxTextArea.setEnabled方法的具體用法?Java RSyntaxTextArea.setEnabled怎麽用?Java RSyntaxTextArea.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setEnabled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createContentPanel
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
/**
* @param debuggerActions
* @return
*/
static Component createContentPanel(final AgentDebuggerFrame frame) {
JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final RSyntaxTextArea scriptEditorTA = new RSyntaxTextArea();
frame.setScriptEditorTA(scriptEditorTA);
scriptEditorTA.setSelectionColor(scriptEditorTA.getCurrentLineHighlightColor());
scriptEditorTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
scriptEditorTA.setHyperlinksEnabled(false);
scriptEditorTA.setEditable(false);
scriptEditorTA.setEnabled(false);
scriptEditorTA.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
scriptEditorTA.grabFocus();
try {
int offs = scriptEditorTA.viewToModel(e.getPoint());
if (offs > -1) {
int line = scriptEditorTA.getLineOfOffset(offs);
if (frame.getSteps().size() > line) {
frame.fireStepChanged(line);
if (e.getClickCount() == 2 && !e.isPopupTrigger()) {
// show step xml
try {
DebugStep debugStep = frame.getSteps().get(line);
String text = JaxbUtil.marshall(debugStep.getStepRun());
StepDialog dlg = new StepDialog(frame, text,
SyntaxConstants.SYNTAX_STYLE_XML);
dlg.setVisible(true);
} catch (JAXBException e1) {
frame.showError("Error showing step xml: " + e);
}
}
}
}
} catch (BadLocationException ble) {
ble.printStackTrace(); // Never happens
}
}
});
RTextScrollPane scriptEditorScrollPane = new RTextScrollPane(scriptEditorTA);
frame.setScriptEditorScrollPane(scriptEditorScrollPane);
scriptEditorScrollPane.setIconRowHeaderEnabled(true);
scriptEditorScrollPane.getGutter().setBookmarkIcon(ActionProducer.getIcon("bullet_blue.png", IconSize.SMALL));
scriptEditorScrollPane.getGutter().setCurrentLineIcon(
ActionProducer.getIcon("current_line.png", IconSize.SMALL));
scriptEditorScrollPane.getGutter().setBookmarkingEnabled(true);
pane.setLeftComponent(scriptEditorScrollPane);
pane.setRightComponent(createRightPanel(frame));
pane.setDividerLocation(300);
pane.setResizeWeight(0.4D);
return pane;
}