org.fife.ui.rtextarea.RTextScrollPane Java Examples
The following examples show how to use
org.fife.ui.rtextarea.RTextScrollPane.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DesktopSourceCodeEditor.java From cuba with Apache License 2.0 | 6 votes |
@Override protected RSyntaxTextArea createTextComponentImpl() { RSyntaxTextArea impl = new RSyntaxTextArea(); int height = (int) impl.getPreferredSize().getHeight(); impl.setMinimumSize(new Dimension(0, height)); RTextScrollPane scrollPane = new RTextScrollPane(impl); scrollPane.setLineNumbersEnabled(showGutter); composition = scrollPane; composition.setPreferredSize(new Dimension(150, height)); composition.setMinimumSize(new Dimension(0, height)); doc.putProperty("filterNewlines", false); return impl; }
Example #2
Source File: CodeEditor.java From drmips with GNU General Public License v3.0 | 6 votes |
/** * 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); }
Example #3
Source File: ViewMenu.java From zap-extensions with Apache License 2.0 | 6 votes |
@Override public void actionPerformed(ActionEvent e) { JTextComponent textComponent = getTextComponent(e); if (textComponent instanceof SyntaxHighlightTextArea) { SyntaxHighlightTextArea httpPanelTextArea = (SyntaxHighlightTextArea) textComponent; Component c = httpPanelTextArea.getParent(); if (c instanceof JViewport) { c = c.getParent(); if (c instanceof RTextScrollPane) { final RTextScrollPane scrollPane = (RTextScrollPane) c; scrollPane.setFoldIndicatorEnabled( !httpPanelTextArea.isCodeFoldingEnabled()); httpPanelTextArea.setCodeFoldingEnabled( !httpPanelTextArea.isCodeFoldingEnabled()); } } } }
Example #4
Source File: Editor.java From jlibs with Apache License 2.0 | 6 votes |
public Editor(final File file, String syntax) throws Exception{ setDefaultCloseOperation(EXIT_ON_CLOSE); textArea.setCodeFoldingEnabled(true); getContentPane().add(new RTextScrollPane(textArea)); textArea.setSyntaxEditingStyle(syntax); textArea.setText(IOUtil.pump(new FileReader(file), true).toString()); file.delete(); pack(); setLocationRelativeTo(null); String actionName = "save-and-quit"; textArea.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.META_MASK), actionName); textArea.getActionMap().put(actionName, new AbstractAction(){ @Override public void actionPerformed(ActionEvent e){ try{ IOUtil.pump(new StringReader(textArea.getText()), new FileWriter(file), true, true); }catch(IOException ex){ ex.printStackTrace(); } System.exit(0); } }); }
Example #5
Source File: HttpPanelJsonView.java From zap-extensions with Apache License 2.0 | 6 votes |
public HttpPanelJsonView(AbstractStringHttpPanelViewModel model) { httpPanelJsonArea = new HttpPanelJsonArea(); RTextScrollPane scrollPane = new RTextScrollPane(httpPanelJsonArea); scrollPane.setLineNumbersEnabled(false); mainPanel = new JPanel(new BorderLayout()); mainPanel.add(scrollPane, BorderLayout.CENTER); this.model = model; model.addHttpPanelViewModelListener(this); httpPanelJsonArea.setComponentPopupMenu( new JPopupMenu() { private static final long serialVersionUID = 1L; @Override public void show(Component invoker, int x, int y) { if (!httpPanelJsonArea.isFocusOwner()) { httpPanelJsonArea.requestFocusInWindow(); } View.getSingleton().getPopupMenu().show(httpPanelJsonArea, x, y); } }); }
Example #6
Source File: MondrianDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 6 votes |
private JPanel createGlobalScriptTab() { final JPanel globalHeader2 = new JPanel( new BorderLayout() ); globalHeader2 .add( new JLabel( Messages.getString( "MondrianDataSourceEditor.GlobalScript" ) ), BorderLayout.CENTER ); globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST ); final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); globalScriptHeader.add( new JLabel( Messages.getString( "MondrianDataSourceEditor.GlobalScriptLanguage" ) ) ); globalScriptHeader.add( globalLanguageField ); globalScriptHeader.add( globalHeader2 ); final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() ); globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH ); globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER ); return globalScriptContentHolder; }
Example #7
Source File: EditorPane.java From 3Dscript with BSD 2-Clause "Simplified" License | 6 votes |
/** * @return this EditorPane wrapped in a {@link RTextScrollPane}. */ public RTextScrollPane wrappedInScrollbars() { final RTextScrollPane sp = new RTextScrollPane(this); sp.setPreferredSize(new Dimension(600, 350)); sp.setIconRowHeaderEnabled(true); gutter = sp.getGutter(); // iconGroup = new IconGroup("bullets", "images/", null, "png", null); // gutter.setBookmarkIcon(iconGroup.getIcon("var")); // URL url = ClassLoader.getSystemClassLoader().getResource("eye.png"); // ImageIcon icon = new ImageIcon(url); // gutter.setBookmarkIcon(icon); // gutter.setBookmarkingEnabled(true); return sp; }
Example #8
Source File: QueryEditorPanel.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 6 votes |
private JPanel createGlobalScriptTab() { final JPanel globalHeader2 = new JPanel( new BorderLayout() ); globalHeader2.add( new JLabel( Messages.getString( "QueryEditorPanel.GlobalScript" ) ), BorderLayout.CENTER ); globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST ); final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); globalScriptHeader.add( new JLabel( Messages.getString( "QueryEditorPanel.GlobalScriptLanguage" ) ) ); globalScriptHeader.add( globalLanguageField ); globalScriptHeader.add( globalHeader2 ); final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() ); globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH ); globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER ); globalScriptContentHolder.setBorder( BorderFactory.createEmptyBorder( 8, 8, 8, 8 ) ); return globalScriptContentHolder; }
Example #9
Source File: ScriptingExpressionEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 6 votes |
public ScriptingExpressionEditor() { statusText = new JLabel(); textArea = new RSyntaxTextArea(); textArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_NONE ); final JPanel queryContentHolder = new JPanel( new BorderLayout() ); queryContentHolder.add( BorderLayout.NORTH, new JLabel( EditorExpressionsMessages.getString( "ScriptingExpressionEditor.Script" ) ) ); queryContentHolder.add( BorderLayout.CENTER, new RTextScrollPane( 500, 300, textArea, true ) ); panel = new JPanel(); panel.setLayout( new BorderLayout() ); panel.add( queryContentHolder, BorderLayout.CENTER ); }
Example #10
Source File: PmdDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
protected Component createContentPane() { final JPanel queryTextAreaHeaderPanel = new JPanel( new BorderLayout() ); queryTextAreaHeaderPanel .add( new JLabel( Messages.getString( "PmdDataSourceEditor.QueryLabel" ) ), BorderLayout.WEST ); queryTextAreaHeaderPanel.add( queryDesignerButton, BorderLayout.EAST ); final JPanel queryConfigurationPanel = new JPanel(); queryConfigurationPanel.setLayout( new BorderLayout() ); queryConfigurationPanel.add( queryTextAreaHeaderPanel, BorderLayout.NORTH ); queryConfigurationPanel.add( new RTextScrollPane( 700, 500, queryTextArea, true ), BorderLayout.CENTER ); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab( Messages.getString( "PmdDataSourceEditor.StaticQuery" ), queryConfigurationPanel ); queryScriptTabPane.addTab( Messages.getString( "PmdDataSourceEditor.QueryScripting" ), createQueryScriptTab() ); final JPanel queryAreaPanel = new JPanel(); queryAreaPanel.setLayout( new BorderLayout() ); queryAreaPanel.add( createGlobalPropertiesPanel(), BorderLayout.NORTH ); queryAreaPanel.add( queryScriptTabPane, BorderLayout.CENTER ); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab( Messages.getString( "PmdDataSourceEditor.DataSource" ), queryAreaPanel ); tabbedPane.addTab( Messages.getString( "PmdDataSourceEditor.GlobalScripting" ), createGlobalScriptTab() ); final JPanel contentPanel = new JPanel( new BorderLayout() ); contentPanel.add( tabbedPane, BorderLayout.CENTER ); contentPanel.add( createPreviewButtonsPanel(), BorderLayout.SOUTH ); contentPanel.setBorder( BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ); return contentPanel; }
Example #11
Source File: QueryEditorPanel.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryScriptTab() { final JPanel queryHeader2 = new JPanel( new BorderLayout() ); queryHeader2.add( new JLabel( Messages.getString( "QueryEditorPanel.QueryScript" ) ), BorderLayout.CENTER ); queryHeader2.add( new JButton( queryTemplateAction ), BorderLayout.EAST ); final JPanel queryScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); queryScriptHeader.add( new JLabel( Messages.getString( "QueryEditorPanel.QueryScriptLanguage" ) ) ); queryScriptHeader.add( queryLanguageField ); queryScriptHeader.add( queryHeader2 ); final JPanel queryScriptContentHolder = new JPanel( new BorderLayout() ); queryScriptContentHolder.add( queryScriptHeader, BorderLayout.NORTH ); queryScriptContentHolder.add( new RTextScrollPane( 700, 300, queryScriptTextArea, true ), BorderLayout.CENTER ); return queryScriptContentHolder; }
Example #12
Source File: Model.java From Luyten with Apache License 2.0 | 5 votes |
public void closeOpenTab(int index) { RTextScrollPane co = (RTextScrollPane) house.getComponentAt(index); RSyntaxTextArea pane = (RSyntaxTextArea) co.getViewport().getView(); OpenFile open = null; for (OpenFile file : hmap) if (pane.equals(file.textArea)) open = file; if (open != null && hmap.contains(open)) hmap.remove(open); house.remove(co); if (open != null) open.close(); }
Example #13
Source File: Model.java From Luyten with Apache License 2.0 | 5 votes |
private void addOrSwitchToTab(final OpenFile open) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { try { final String title = open.name; RTextScrollPane rTextScrollPane = open.scrollPane; int index = house.indexOfTab(title); if (index > -1 && house.getTabComponentAt(index) != open.scrollPane) { index = -1; for (int i = 0; i < house.getTabCount(); i++) { if (house.getComponentAt(i) == open.scrollPane) { index = i; break; } } } if (index < 0) { house.addTab(title, rTextScrollPane); index = house.indexOfComponent(rTextScrollPane); house.setSelectedIndex(index); Tab ct = new Tab(title); ct.getButton().addMouseListener(new CloseTab(title)); house.setTabComponentAt(index, ct); } else { house.setSelectedIndex(index); } open.onAddedToScreen(); } catch (Exception e) { Luyten.showExceptionDialog("Exception!", e); } } }); }
Example #14
Source File: Olap4JDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryScriptTab() { final JPanel queryHeader2 = new JPanel( new BorderLayout() ); queryHeader2.add( new JLabel( Messages.getString( "Olap4JDataSourceEditor.QueryScript" ) ), BorderLayout.CENTER ); queryHeader2.add( new JButton( queryTemplateAction ), BorderLayout.EAST ); final JPanel queryScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); queryScriptHeader.add( new JLabel( Messages.getString( "Olap4JDataSourceEditor.QueryScriptLanguage" ) ) ); queryScriptHeader.add( queryLanguageField ); queryScriptHeader.add( queryHeader2 ); final JPanel queryScriptContentHolder = new JPanel( new BorderLayout() ); queryScriptContentHolder.add( queryScriptHeader, BorderLayout.NORTH ); queryScriptContentHolder.add( new RTextScrollPane( 700, 300, queryScriptTextArea, true ), BorderLayout.CENTER ); return queryScriptContentHolder; }
Example #15
Source File: PaneUpdaterThread.java From bytecode-viewer with GNU General Public License v3.0 | 5 votes |
public void attachCtrlMouseWheelZoom(RTextScrollPane scrollPane, RSyntaxTextArea panelArea) { if(scrollPane == null) return; scrollPane.addMouseWheelListener(new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { if(panelArea == null || panelArea.getText().isEmpty()) return; if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0) { Font font = panelArea.getFont(); int size = font.getSize(); if(e.getWheelRotation() > 0) { //Up panelArea.setFont(new Font(font.getName(), font.getStyle(), --size >= 2 ? --size : 2)); } else { //Down panelArea.setFont(new Font(font.getName(), font.getStyle(), ++size)); } } e.consume(); } }); }
Example #16
Source File: PopUpWindow.java From SikuliNG with MIT License | 5 votes |
public PopUpWindow() { JPanel contentPane = new JPanel(new BorderLayout()); RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60); textArea.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { if (e.getExtendedKeyCode() == KeyEvent.VK_ESCAPE) { setVisible(false); int modifiers = e.getModifiers(); if (modifiers == KeyEvent.CTRL_MASK) { cellText = textArea.getText(); if (!checkText(cellText)) { cellText = resetText; } script.table.setValueAt(cellText, row, col + 1); script.table.setSelection(row, col + 1); } return; } super.keyTyped(e); } }); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); textArea.setMarkOccurrences(true); contentPane.add(new RTextScrollPane(textArea)); CompletionProvider provider = createCompletionProvider(); AutoCompletion ac = new AutoCompletion(provider); // ((AbstractCompletionProvider)provider).setAutoActivationRules(true, null); ac.setAutoActivationEnabled(true); ac.install(textArea); // ac.setAutoCompleteSingleChoices(true); setContentPane(contentPane); setTitle("AutoComplete Demo"); setUndecorated(true); setAlwaysOnTop(true); pack(); cellTextArea = textArea; }
Example #17
Source File: PmdDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryScriptTab() { final JPanel queryHeader2 = new JPanel( new BorderLayout() ); queryHeader2.add( new JLabel( Messages.getString( "PmdDataSourceEditor.QueryScript" ) ), BorderLayout.CENTER ); queryHeader2.add( new JButton( queryTemplateAction ), BorderLayout.EAST ); final JPanel queryScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); queryScriptHeader.add( new JLabel( Messages.getString( "PmdDataSourceEditor.QueryScriptLanguage" ) ) ); queryScriptHeader.add( queryLanguageField ); queryScriptHeader.add( queryHeader2 ); final JPanel queryScriptContentHolder = new JPanel( new BorderLayout() ); queryScriptContentHolder.add( queryScriptHeader, BorderLayout.NORTH ); queryScriptContentHolder.add( new RTextScrollPane( 700, 300, queryScriptTextArea, true ), BorderLayout.CENTER ); return queryScriptContentHolder; }
Example #18
Source File: PeerInfoWindow.java From ethereumj with MIT License | 5 votes |
/** * ERROR (exceptions) WARN (when something happens that's not supposed to) * INFO (wire output) * DEBUG (test/displaying intermediate values), * TRACE (start/end method) */ public PeerInfoWindow(PeersTableModel.PeerInfo peerInfo) { final PeerInfoWindow thisConsole = this; java.net.URL url = ClassLoader.getSystemResource("ethereum-icon.png"); Toolkit kit = Toolkit.getDefaultToolkit(); Image img = kit.createImage(url); this.setIconImage(img); addCloseAction(); JPanel cp = new JPanel(new BorderLayout()); AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance(); atmf.putMapping("text/console", "org.ethereum.gui.ConsoleTokenMaker"); textArea = new RSyntaxTextArea(16, 44); textArea.setSyntaxEditingStyle("text/console"); // textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_LISP); textArea.setCodeFoldingEnabled(true); textArea.setAntiAliasingEnabled(true); RTextScrollPane sp = new RTextScrollPane(textArea); textArea.setText(peerInfo.toString()); cp.add(sp); setContentPane(cp); setTitle("Connection Console"); // setDefaultCloseOperation(EXIT_ON_CLOSE); pack(); setLocation(802, 460); if (CONFIG.peerDiscovery()) UIEthereumManager.ethereum.startPeerDiscovery(); }
Example #19
Source File: OverlayRSyntaxScrollPane.java From darklaf with MIT License | 5 votes |
@Override public JComponent createComponent() { RSyntaxTextArea textArea = new RSyntaxTextArea(StringUtil.repeat(DemoResources.LOREM_IPSUM, 5)); RTextScrollPane sp = new RTextScrollPane(textArea); OverlayScrollPane scrollPane = new OverlayScrollPane(sp); return new DemoPanel(scrollPane, new BorderLayout(), 0); }
Example #20
Source File: PmdDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createGlobalScriptTab() { final JPanel globalHeader2 = new JPanel( new BorderLayout() ); globalHeader2.add( new JLabel( Messages.getString( "PmdDataSourceEditor.GlobalScript" ) ), BorderLayout.CENTER ); globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST ); final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); globalScriptHeader.add( new JLabel( Messages.getString( "PmdDataSourceEditor.GlobalScriptLanguage" ) ) ); globalScriptHeader.add( globalLanguageField ); globalScriptHeader.add( globalHeader2 ); final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() ); globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH ); globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER ); return globalScriptContentHolder; }
Example #21
Source File: Olap4JDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createGlobalScriptTab() { final JPanel globalHeader2 = new JPanel( new BorderLayout() ); globalHeader2.add( new JLabel( Messages.getString( "Olap4JDataSourceEditor.GlobalScript" ) ), BorderLayout.CENTER ); globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST ); final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); globalScriptHeader.add( new JLabel( Messages.getString( "Olap4JDataSourceEditor.GlobalScriptLanguage" ) ) ); globalScriptHeader.add( globalLanguageField ); globalScriptHeader.add( globalHeader2 ); final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() ); globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH ); globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER ); return globalScriptContentHolder; }
Example #22
Source File: JdbcDataSourceDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryScriptTab() { final JPanel queryHeader2 = new JPanel( new BorderLayout() ); queryHeader2.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.QueryScript" ) ), BorderLayout.CENTER ); queryHeader2.add( new JButton( queryTemplateAction ), BorderLayout.EAST ); final JPanel queryScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); queryScriptHeader.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.QueryScriptLanguage" ) ) ); queryScriptHeader.add( queryLanguageField ); queryScriptHeader.add( queryHeader2 ); final JPanel queryScriptContentHolder = new JPanel( new BorderLayout() ); queryScriptContentHolder.add( queryScriptHeader, BorderLayout.NORTH ); queryScriptContentHolder.add( new RTextScrollPane( 700, 300, queryScriptTextArea, true ), BorderLayout.CENTER ); return queryScriptContentHolder; }
Example #23
Source File: ViewMenu.java From zap-extensions with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent e) { JTextComponent textComponent = getTextComponent(e); if (textComponent instanceof SyntaxHighlightTextArea) { SyntaxHighlightTextArea httpPanelTextArea = (SyntaxHighlightTextArea) textComponent; Component c = httpPanelTextArea.getParent(); if (c instanceof JViewport) { c = c.getParent(); if (c instanceof RTextScrollPane) { final RTextScrollPane scrollPane = (RTextScrollPane) c; scrollPane.setLineNumbersEnabled(!scrollPane.getLineNumbersEnabled()); } } } }
Example #24
Source File: ViewMenu.java From zap-extensions with Apache License 2.0 | 5 votes |
public void updateState(SyntaxHighlightTextArea httpPanelTextArea) { antiAliasingOption.setSelected(httpPanelTextArea.getAntiAliasingEnabled()); boolean selected = false; boolean enabled = false; Component c = httpPanelTextArea.getParent(); if (c instanceof JViewport) { c = c.getParent(); if (c instanceof RTextScrollPane) { enabled = true; final RTextScrollPane scrollPane = (RTextScrollPane) c; selected = scrollPane.getLineNumbersEnabled(); } } lineNumbersOption.setVisible(enabled); lineNumbersOption.setSelected(selected); wordWrapOption.setSelected(httpPanelTextArea.getLineWrap()); codeFoldingAction.setVisible(enabled); codeFoldingAction.setSelected(httpPanelTextArea.isCodeFoldingEnabled()); highlightCurrentLineOption.setSelected(httpPanelTextArea.getHighlightCurrentLine()); fadeCurrentHighlightLineOption.setSelected(httpPanelTextArea.getFadeCurrentLineHighlight()); showWhitespacesOption.setSelected(httpPanelTextArea.isWhitespaceVisible()); showNewlinesOption.setSelected(httpPanelTextArea.getEOLMarkersVisible()); markOccurrencesOption.setSelected(httpPanelTextArea.getMarkOccurrences()); roundedSelectionEdgesOption.setSelected(httpPanelTextArea.getRoundedSelectionEdges()); bracketMatchingOption.setSelected(httpPanelTextArea.isBracketMatchingEnabled()); animatedBracketMatchingOption.setSelected(httpPanelTextArea.getAnimateBracketMatching()); }
Example #25
Source File: JdbcDataSourceDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createGlobalScriptTab() { final JPanel globalHeader2 = new JPanel( new BorderLayout() ); globalHeader2.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.GlobalScript" ) ), BorderLayout.CENTER ); globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST ); final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); globalScriptHeader.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.GlobalScriptLanguage" ) ) ); globalScriptHeader.add( globalLanguageField ); globalScriptHeader.add( globalHeader2 ); final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() ); globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH ); globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER ); return globalScriptContentHolder; }
Example #26
Source File: JdbcDataSourceDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryDetailsPanel() { final JPanel queryNamePanel = new JPanel( new BorderLayout() ); queryNamePanel.setBorder( BorderFactory.createEmptyBorder( 8, 8, 0, 8 ) ); queryNamePanel.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.QueryStringLabel" ) ), BorderLayout.NORTH ); queryNamePanel.add( queryNameTextField, BorderLayout.SOUTH ); final InvokeQueryDesignerAction queryDesignerAction = new InvokeQueryDesignerAction(); dialogModel.addPropertyChangeListener( queryDesignerAction ); final JPanel queryButtonsPanel = new JPanel( new FlowLayout( FlowLayout.RIGHT, 5, 5 ) ); queryButtonsPanel.add( new BorderlessButton( queryDesignerAction ) ); final JPanel queryControlsPanel = new JPanel( new BorderLayout() ); queryControlsPanel.add( new JLabel( Messages.getString( "JdbcDataSourceDialog.QueryDetailsLabel" ) ), BorderLayout.WEST ); queryControlsPanel.add( queryButtonsPanel, BorderLayout.EAST ); final JPanel queryPanel = new JPanel( new BorderLayout() ); queryPanel.add( queryControlsPanel, BorderLayout.NORTH ); queryPanel.add( new RTextScrollPane( 500, 300, queryTextArea, true ), BorderLayout.CENTER ); queryPanel.setBorder( BorderFactory.createEmptyBorder( 8, 8, 0, 8 ) ); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab( Messages.getString( "JdbcDataSourceDialog.StaticQuery" ), queryPanel ); queryScriptTabPane.addTab( Messages.getString( "JdbcDataSourceDialog.QueryScripting" ), createQueryScriptTab() ); // Create the query details panel final JPanel queryDetailsPanel = new JPanel( new BorderLayout() ); queryDetailsPanel.add( BorderLayout.NORTH, queryNamePanel ); queryDetailsPanel.add( BorderLayout.CENTER, queryScriptTabPane ); return queryDetailsPanel; }
Example #27
Source File: MainFrame.java From jsflight with Apache License 2.0 | 5 votes |
private void configureScriptTextArea(RSyntaxTextArea eventContent, RTextScrollPane scrollPane_2, String syntaxStyle) { eventContent.setSyntaxEditingStyle(syntaxStyle); eventContent.getFoldManager().setCodeFoldingEnabled(true); eventContent.setFont(new Font("Hack", Font.PLAIN, 16)); eventContent.setRows(3); eventContent.setMarkOccurrences(true); eventContent.setLineWrap(true); eventContent.setWrapStyleWord(true); scrollPane_2.setLineNumbersEnabled(true); scrollPane_2.setFoldIndicatorEnabled(true); }
Example #28
Source File: XMLEditor.java From rapidminer-studio with GNU Affero General Public License v3.0 | 5 votes |
public XMLEditor(MainFrame mainFrame) { super(new BorderLayout()); this.mainFrame = mainFrame; // create text area this.editor = new RSyntaxTextArea(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_XML)) { @Override public synchronized void setText(String t) { super.setText(t); } }; this.editor.setAnimateBracketMatching(true); this.editor.setAutoIndentEnabled(true); this.editor.setSelectionColor(Colors.TEXT_HIGHLIGHT_BACKGROUND); this.editor.setBorder(null); JToolBar toolBar = new ExtendedJToolBar(); toolBar.setBorder(null); toolBar.add(new ResourceAction(true, "xml_editor.apply_changes") { private static final long serialVersionUID = 1L; @Override public void loggedActionPerformed(ActionEvent e) { try { validateProcess(); } catch (IOException | XMLException e1) { LogService.getRoot().log(Level.WARNING, "com.rapidminer.gui.processeditor.XMLEditor.failed_to_parse_process"); } } }); toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER)); add(toolBar, BorderLayout.NORTH); RTextScrollPane rTextScrollPane = new RTextScrollPane(editor); rTextScrollPane.setBorder(null); add(rTextScrollPane, BorderLayout.CENTER); }
Example #29
Source File: DyIOchannelWidget.java From BowlerStudio with GNU General Public License v3.0 | 5 votes |
private void setUpListenerPanel(){ //Platform.runLater(()->{ textArea = new RSyntaxTextArea(15, 80); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY); textArea.setCodeFoldingEnabled(true); textArea.setText("return new IChannelEventListener() { \n"+ "\tpublic \n" + "\tvoid onChannelEvent(DyIOChannelEvent dyioEvent){\n"+ "\t\tprintln \"From Listener=\"+dyioEvent.getValue();\n"+ "\t}\n"+ "}" ); sp = new RTextScrollPane(textArea); sn = new SwingNode(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { sn.setContent(sp); } }); Platform.runLater(()->listenerCodeBox.getChildren().setAll(sn)); listenerCodeBox.setFocusTraversable(false); sn.setOnMouseEntered(mouseEvent -> { sn.requestFocus(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { textArea.requestFocusInWindow(); } }); }); //}); }
Example #30
Source File: MondrianDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JPanel createQueryScriptTab() { final JPanel queryHeader2 = new JPanel( new BorderLayout() ); queryHeader2.add( new JLabel( Messages.getString( "MondrianDataSourceEditor.QueryScript" ) ), BorderLayout.CENTER ); queryHeader2.add( new JButton( queryTemplateAction ), BorderLayout.EAST ); final JPanel queryScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) ); queryScriptHeader.add( new JLabel( Messages.getString( "MondrianDataSourceEditor.QueryScriptLanguage" ) ) ); queryScriptHeader.add( queryLanguageField ); queryScriptHeader.add( queryHeader2 ); final JPanel queryScriptContentHolder = new JPanel( new BorderLayout() ); queryScriptContentHolder.add( queryScriptHeader, BorderLayout.NORTH ); queryScriptContentHolder.add( new RTextScrollPane( 700, 300, queryScriptTextArea, true ), BorderLayout.CENTER ); return queryScriptContentHolder; }