Refine search
public FindAndReplaceDemo() { JPanel cp = new JPanel(new BorderLayout()); RTextScrollPane sp = new RTextScrollPane(textArea); cp.add(sp); matchCaseCB = new JCheckBox("Match Case"); toolBar.add(matchCaseCB); cp.add(toolBar, BorderLayout.NORTH);
/** * Creates a scroll pane. * * @param comp The component this scroll pane should display. This should * be an instance of {@link RTextArea}, * <code>javax.swing.JLayer</code> (or the older * <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>. * If this argument is <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an instance of * one of the types above. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(Component comp, boolean lineNumbers, Color lineNumberColor) { super(comp); RTextArea textArea = getFirstRTextAreaDescendant(comp); // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
DemoRootPane() { textArea = createTextArea(); setText("JavaExample.txt"); textArea.setSyntaxEditingStyle(SYNTAX_STYLE_JAVA); scrollPane = new RTextScrollPane(textArea, true); Gutter gutter = scrollPane.getGutter(); gutter.setBookmarkingEnabled(true); URL url = getClass().getResource("bookmark.png"); gutter.setBookmarkIcon(new ImageIcon(url)); getContentPane().add(scrollPane); ErrorStrip errorStrip = new ErrorStrip(textArea); //errorStrip.setBackground(java.awt.Color.blue); getContentPane().add(errorStrip, BorderLayout.LINE_END); setJMenuBar(createMenuBar()); }
else textArea.setSyntaxEditingStyle(SYNTAX_STYLE_PROPERTIES_FILE); scrollPane = new RTextScrollPane(textArea, true); scrollPane.setIconRowHeaderEnabled(true); textArea.setText(""); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); final JScrollBar verticalScrollbar = scrollPane.getVerticalScrollBar(); if (verticalScrollbar != null) { verticalScrollbar.addAdjustmentListener(new AdjustmentListener() { for (MouseWheelListener listeners : scrollPane.getMouseWheelListeners()) { scrollPane.removeMouseWheelListener(listeners); scrollPane.addMouseWheelListener(new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) {
@Override public void actionPerformed(ActionEvent e) { scrollPane.setLineNumbersEnabled( !scrollPane.getLineNumbersEnabled()); }
if (scrollPane.isWheelScrollingEnabled() && e.getWheelRotation() != 0) { JScrollBar toScroll = scrollPane.getVerticalScrollBar(); int direction = e.getWheelRotation() < 0 ? -1 : 1; int orientation = SwingConstants.VERTICAL; if (toScroll == null || !toScroll.isVisible()) { toScroll = scrollPane.getHorizontalScrollBar(); if (toScroll == null || !toScroll.isVisible()) { return; JViewport vp = scrollPane.getViewport(); if (vp == null) { return;
private void init() { mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); httpPanelTextArea = createHttpPanelTextArea(); httpPanelTextArea.setEditable(false); httpPanelTextArea.setComponentPopupMenu(new CustomPopupMenu()); JScrollPane scrollPane = new RTextScrollPane(httpPanelTextArea, false); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); mainPanel.add(scrollPane, BorderLayout.CENTER); }
add(splitPaneMain, BorderLayout.CENTER); JPanel panelTop = new JPanel(); splitPaneMain.setLeftComponent(panelTop); panelTop.setLayout(new BorderLayout(0, 0)); panelTop.add(splitPaneTop); scrollPane = new RTextScrollPane(textArea); scrollPane.add(textArea); panelText.add(scrollPane, BorderLayout.CENTER); scrollPane.setViewportView(textArea);
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; }
RTextScrollPane scrollPane = new RTextScrollPane(textArea, true); scrollPane.setIconRowHeaderEnabled(true); scrollPane.getGutter().setBookmarkingEnabled(true); JPanel cp = new JPanel(new BorderLayout()); cp.add(sp); cp.add(errorStrip, BorderLayout.LINE_END); setContentPane(cp);
public static void main(String args[]) { SwingUtilities.invokeLater(() -> { WebLookAndFeel.install(); JFrame frame = new JFrame("Teste Editor"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(800, 600); JPanel painel = new JPanel(new BorderLayout()); Editor editor = new Editor(); editor.scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); editor.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); StringBuilder builder = new StringBuilder(); for (int i = 0; i < 60; i++) { builder.append("linha ").append(String.valueOf(i)).append("\n"); } editor.setCodigoFonte(builder.toString()); painel.add(editor); WeblafUtils.configuraWeblaf(painel); frame.getContentPane().add(painel, BorderLayout.CENTER); frame.setVisible(true); }); }
protected JComponent getQueryEditor() { return new RTextScrollPane( 500, 300, queryTextArea, true ); } }
add(lblCookieFlags, gbc_lblCookieFlags); RTextScrollPane sp = new RTextScrollPane(outputField); sp.setLineNumbersEnabled(false);
rTextScrollPane1 = new org.fife.ui.rtextarea.RTextScrollPane(rSyntaxTextArea); rTextScrollPane1.setFoldIndicatorEnabled(true); rTextScrollPane1.setLineNumbersEnabled(true);
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new org.fife.ui.rtextarea.RTextScrollPane(); textArea = new PSTextArea(new PortugolDocumento()); setOpaque(false); setLayout(new java.awt.BorderLayout()); scrollPane.setBorder(null); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 0, 0)); scrollPane.setName("scrollPaneEditor"); // NOI18N scrollPane.setOpaque(false); textArea.setBorder(null); textArea.setToolTipText(""); textArea.setCodeFoldingEnabled(true); textArea.setName("textAreaEditor"); // NOI18N scrollPane.setViewportView(textArea); add(scrollPane, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents
updateOracle = new javax.swing.JToggleButton(); jLabel4 = new javax.swing.JLabel(); finalPayloadScrollPane = new org.fife.ui.rtextarea.RTextScrollPane(); finalPayload = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea(); payloadComboBox = new javax.swing.JComboBox(); jScrollPane1 = new javax.swing.JScrollPane(); attackDescriptionTextArea = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea(); rTextScrollPane1 = new org.fife.ui.rtextarea.RTextScrollPane(); payloadValue = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea(); finalPayloadScrollPane.setLineNumbersEnabled(true); finalPayload.setRows(5); finalPayload.setSyntaxEditingStyle("text/xml"); finalPayloadScrollPane.setViewportView(finalPayload); rTextScrollPane1.setViewportView(payloadValue);
/** * Creates a scroll pane with preferred size (width, height). * * @param area The text area this scroll pane will contain. If this is * <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an * {@link RTextArea}. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(RTextArea area, boolean lineNumbers, Color lineNumberColor) { super(area); // Create the text area and set it inside this scroll bar area. textArea = area; // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
textArea.setLineWrap(false); sp = new RTextScrollPane(textArea); sp.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); checkBox = new JCheckBox("Softwraps for long lines"); checkBox.setSelected(false);
private void $initialize() { if (allComponentsCreated) { return; } if (log.isDebugEnabled()) { log.debug(this); } $objectMap.put("$JPanel0", $JPanel0); // inline creation of $RTextScrollPane0 $objectMap.put("$RTextScrollPane0", $RTextScrollPane0 = new RTextScrollPane()); $RTextScrollPane0.setName("$RTextScrollPane0"); createFieldSimulPreScript(); // inline creation of $JButton0 $objectMap.put("$JButton0", $JButton0 = new JButton()); $JButton0.setName("$JButton0"); $JButton0.setText(t("isisfish.preScript.backParameter")); $JButton0.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__$JButton0")); // inline creation of $JPanel0 setName("$JPanel0"); setLayout(new BorderLayout()); /*protected void backParameter() { SimulUI simul = getParentContainer(SimulUI.class); simul.selTab(0); }*/;$completeSetup(); }
/** * Returns the gutter component of the scroll pane containing a text * area, if any. * * @param textArea The text area. * @return The gutter, or <code>null</code> if the text area is not in * an {@link RTextScrollPane}. * @see RTextScrollPane#getGutter() */ public static Gutter getGutter(RTextArea textArea) { Gutter gutter = null; Container parent = textArea.getParent(); if (parent instanceof JViewport) { parent = parent.getParent(); if (parent instanceof RTextScrollPane) { RTextScrollPane sp = (RTextScrollPane)parent; gutter = sp.getGutter(); // Should always be non-null } } return gutter; }