本文整理匯總了Java中org.fife.ui.rtextarea.RTextScrollPane.setIconRowHeaderEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java RTextScrollPane.setIconRowHeaderEnabled方法的具體用法?Java RTextScrollPane.setIconRowHeaderEnabled怎麽用?Java RTextScrollPane.setIconRowHeaderEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rtextarea.RTextScrollPane
的用法示例。
在下文中一共展示了RTextScrollPane.setIconRowHeaderEnabled方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBottomPanel
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
/**
* @param debuggerActions
* @param loadChooser
* @return
*/
static Component createBottomPanel(final AgentDebuggerFrame frame) {
JPanel panel = new JPanel(new BorderLayout());
RSyntaxTextArea loggerTA = new RSyntaxTextArea();
frame.setLoggerTA(loggerTA);
loggerTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
loggerTA.setHyperlinksEnabled(false);
loggerTA.setEditable(false);
loggerTA.setHighlightCurrentLine(false);
JPopupMenu popupMenu = new JPopupMenu();
popupMenu.add(frame.getDebuggerActions().getSaveLogAction());
popupMenu.add(frame.getDebuggerActions().getClearLogOutputAction());
loggerTA.setPopupMenu(popupMenu);
RTextScrollPane sp = new RTextScrollPane(loggerTA);
sp.setIconRowHeaderEnabled(false);
sp.getGutter().setBookmarkingEnabled(false);
panel.add(sp, BorderLayout.CENTER);
DebuggerAppender.addTextArea(loggerTA);
return panel;
}
示例2: StepDialog
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public StepDialog(AgentDebuggerFrame f, String text, String type) {
super(f, true);
this.f = f;
setLayout(new BorderLayout());
ta = new RSyntaxTextArea();
ta.setSyntaxEditingStyle(type);
ta.setHyperlinksEnabled(false);
ta.setText(text);
ta.setCaretPosition(0);
RTextScrollPane sp = new RTextScrollPane(ta);
sp.setIconRowHeaderEnabled(true);
add(BorderLayout.CENTER, sp);
add(createButtonPanel(), BorderLayout.SOUTH);
setSize(new Dimension(800, 600));
setBounds(new Rectangle(getSize()));
setPreferredSize(getSize());
WindowUtil.centerOnParent(this);
}
示例3: CodeEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
/**
* Creates the code editor.
*/
public CodeEditor() {
super();
scrollPane = new RTextScrollPane(this);
scrollPane.setIconRowHeaderEnabled(true);
setRows(20);
setColumns(80);
setMarginLinePosition(80);
setAntiAliasingEnabled(true);
//setMarkOccurrences(true);
setLineWrap(true);
setColors();
completeProvider = new MIPSCompletionProvider();
complete = new AutoCompletion(completeProvider);
complete.setShowDescWindow(true);
complete.setAutoCompleteSingleChoices(false);
complete.install(this);
}
示例4: QueryEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public QueryEditor(SyntaxElementSource syntaxElementSource, CompletionsSource completionsSource,
ClientSettings clientSettings) {
Check.notNull(syntaxElementSource);
this.syntaxElementSource = syntaxElementSource;
this.completionsSource = completionsSource;
this.clientSettings = clientSettings;
queryText = createTextArea();
queryText.addParser(new GftParser(syntaxElementSource, onStartParsing, onFinshParsing));
queryText.setMarkOccurrences(false);
queryText.setHighlightCurrentLine(clientSettings.highlightCurrentLine);
queryText.setParserDelay(700);
waitStateDisplay = new WaitStateDisplay(queryText);
scrollPane = new RTextScrollPane(queryText, false);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
Gutter gutter = scrollPane.getGutter();
gutter.setBookmarkingEnabled(true);
scrollPane.setIconRowHeaderEnabled(true);
scrollPane.setLineNumbersEnabled(clientSettings.lineNumbersEnabled);
setTheme(clientSettings.editorThemeXml);
URL url = getClass().getResource(Const.resourcePath + "bookmark.png");
gutter.setBookmarkIcon(new ImageIcon(url));
getContentPane().add(scrollPane);
ErrorStrip errorStrip = new ErrorStrip(queryText);
getContentPane().add(errorStrip, BorderLayout.LINE_END);
setCompletionProvider();
setTokenMaker();
queryText.setSyntaxEditingStyle(Const.languageId);
registerForLongOperationEvent();
}
示例5: SyntaxSnippetEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public SyntaxSnippetEditor() {
textArea = new RSyntaxTextArea(20, 20);
textArea.setCodeFoldingEnabled(true);
scrollPane = new RTextScrollPane(textArea);
scrollPane.setLineNumbersEnabled(false);
scrollPane.setIconRowHeaderEnabled(false);
GuiUtil.removeBorder(scrollPane);
}
示例6: JavaEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public JavaEditor(JavaFile file) {
this.file = file;
mainSplitPane = new JSplitPane();
mainSplitPane.setContinuousLayout(true);
mainSplitPane.setResizeWeight(0.5);
textArea = new RSyntaxTextArea();
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setEditable(false);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setClearWhitespaceLinesEnabled(true);
textArea.setCodeFoldingEnabled(true);
textArea.setPaintMarkOccurrencesBorder(true);
textArea.setPaintMatchedBracketPair(true);
textArea.setMarkOccurrences(true);
textArea.getCaret().addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent paramChangeEvent) {
textArea.getCaret().setVisible(true);
}
});
int mod = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
ResourceBundle msg = ResourceBundle.getBundle("org.fife.ui.rtextarea.RTextArea");
RecordableTextAction copyAction = new RTextAreaEditorKit.CopyAction();
copyAction.setProperties(msg, "Action.Copy");
copyAction.setAccelerator(KeyStroke.getKeyStroke(67, mod));
JPopupMenu menu = new JPopupMenu();
menu.add(createPopupMenuItem(copyAction));
menu.add(createPopupMenuItem(new RenameAction()));
textArea.setPopupMenu(menu);
textArea.setText(
"package abc;\r\n\r\npublic class Example{\r\n\tprivate int example = 0;\r\n\t\r\n\tpublic void example(){\r\n\t\tSystem.out.println(\"hi!\");\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args){\r\n\t\texample();\r\n\t}\r\n}");
textArea.convertSpacesToTabs();
theme.apply(textArea);
RTextScrollPane scrollPane = new RTextScrollPane(textArea, true);
scrollPane.getGutter().setBookmarkingEnabled(true);
scrollPane.getGutter()
.setBookmarkIcon(new ImageIcon(EditorWindow.class.getResource("/resources/menu/connection.gif")));
scrollPane.setIconRowHeaderEnabled(true);
scrollPane.setFoldIndicatorEnabled(true);
mainSplitPane.setLeftComponent(scrollPane);
JScrollPane treeScrollPane = new JScrollPane();
mainSplitPane.setRightComponent(treeScrollPane);
JTree tree = new JTree();
tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Example") {
{
DefaultMutableTreeNode node_1;
node_1 = new DefaultMutableTreeNode("Variables");
node_1.add(new DefaultMutableTreeNode("int example"));
add(node_1);
node_1 = new DefaultMutableTreeNode("Methods");
node_1.add(new DefaultMutableTreeNode("public void example()"));
node_1.add(new DefaultMutableTreeNode("public static void main(String[] args)"));
add(node_1);
add(new DefaultMutableTreeNode("Patches"));
}
}));
treeScrollPane.setViewportView(tree);
}
示例7: createContentPanel
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的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;
}
示例8: DemoRootPane
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public DemoRootPane() {
JPanel cp = new JPanel(new BorderLayout());
textArea = createTextArea();
setText("ZScriptExample.txt");
scrollPane = new RTextScrollPane(textArea, true);
scrollPane.setIconRowHeaderEnabled(true);
JPanel topRightPanel = new JPanel(new BorderLayout());
topRightPanel.add(scrollPane);
ErrorStrip errorStrip = new ErrorStrip(textArea);
topRightPanel.add(errorStrip, BorderLayout.LINE_END);
// Dummy tree keeps JViewport's "background" looking right initially
ZScriptOutlineTree tree = new ZScriptOutlineTree();
tree.listenTo(textArea);
treeSP = new JScrollPane(tree);
String[] columnNames = { "", "Line", "Error" };
errorTableModel = new ErrorTableModel(columnNames, 0);
errorTable = new ErrorTable(errorTableModel, textArea);
JScrollPane errorTableScrollPane = new JScrollPane(errorTable);
final JSplitPane rhsSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
topRightPanel, errorTableScrollPane);
rhsSplitPane.setUI(new CleanSplitPaneUI());
rhsSplitPane.setContinuousLayout(true);
rhsSplitPane.setResizeWeight(1);
final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
treeSP, rhsSplitPane);
sp.setUI(new CleanSplitPaneUI());
sp.setContinuousLayout(true);
sp.setResizeWeight(0);
cp.add(sp);
setJMenuBar(createMenuBar());
setContentPane(cp);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
rhsSplitPane.setDividerLocation(0.70);
sp.setDividerLocation(0.25);
textArea.requestFocusInWindow();
}
});
textArea.addPropertyChangeListener(RSyntaxTextArea.PARSER_NOTICES_PROPERTY,
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
List<ParserNotice> notices = textArea.getParserNotices();
refreshErrorTable(notices);
}
}
);
searchContext = new SearchContext();
}
示例9: DemoRootPane
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public DemoRootPane() {
LanguageSupportFactory lsf = LanguageSupportFactory.get();
LanguageSupport support = lsf.getSupportFor(SYNTAX_STYLE_JAVA);
JavaLanguageSupport jls = (JavaLanguageSupport)support;
// TODO: This API will change! It will be easier to do per-editor
// changes to the build path.
try {
jls.getJarManager().addCurrentJreClassFileSource();
//jsls.getJarManager().addClassFileSource(ji);
} catch (IOException ioe) {
ioe.printStackTrace();
}
// Dummy tree keeps JViewport's "background" looking right initially
JTree dummy = new JTree((TreeNode)null);
treeSP = new JScrollPane(dummy);
textArea = createTextArea();
setText("CExample.txt", SYNTAX_STYLE_C);
scrollPane = new RTextScrollPane(textArea, true);
scrollPane.setIconRowHeaderEnabled(true);
scrollPane.getGutter().setBookmarkingEnabled(true);
final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
treeSP, scrollPane);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
sp.setDividerLocation(0.25);
}
});
sp.setContinuousLayout(true);
// setContentPane(sp);
setJMenuBar(createMenuBar());
ErrorStrip errorStrip = new ErrorStrip(textArea);
//errorStrip.setBackground(java.awt.Color.blue);
JPanel cp = new JPanel(new BorderLayout());
cp.add(sp);
cp.add(errorStrip, BorderLayout.LINE_END);
setContentPane(cp);
}