org.fife.ui.rsyntaxtextarea.RSyntaxTextArea Java Examples

The following examples show how to use org.fife.ui.rsyntaxtextarea.RSyntaxTextArea. 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: CommonSearchDialog.java    From jadx with Apache License 2.0 6 votes vote down vote up
private Component makeCell(JNode node, int column) {
	if (column == 0) {
		JLabel label = new JLabel(node.makeLongStringHtml() + "  ", node.getIcon(), SwingConstants.LEFT);
		label.setFont(font);
		label.setOpaque(true);
		label.setToolTipText(label.getText());
		return label;
	}
	if (!node.hasDescString()) {
		return emptyLabel;
	}
	RSyntaxTextArea textArea = AbstractCodeArea.getDefaultArea(mainWindow);
	textArea.setLayout(new GridLayout(1, 1));
	textArea.setEditable(false);
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
	textArea.setText("  " + node.makeDescString());
	textArea.setRows(1);
	textArea.setColumns(textArea.getText().length() + 1);
	if (highlightText != null) {
		SearchContext searchContext = new SearchContext(highlightText);
		searchContext.setMatchCase(!highlightTextCaseInsensitive);
		searchContext.setMarkAll(true);
		SearchEngine.markAll(textArea, searchContext);
	}
	return textArea;
}
 
Example #2
Source File: CommonSearchDialog.java    From jadx with Apache License 2.0 6 votes vote down vote up
private void updateSelection(JTable table, Component comp, boolean isSelected) {
	if (comp instanceof RSyntaxTextArea) {
		if (isSelected) {
			comp.setBackground(codeSelectedColor);
		} else {
			comp.setBackground(codeBackground);
		}
	} else {
		if (isSelected) {
			comp.setBackground(table.getSelectionBackground());
			comp.setForeground(table.getSelectionForeground());
		} else {
			comp.setBackground(table.getBackground());
			comp.setForeground(table.getForeground());
		}
	}
}
 
Example #3
Source File: ScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
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 #4
Source File: SyntaxPane.java    From otroslogviewer with Apache License 2.0 6 votes vote down vote up
public static RSyntaxTextArea propertiesTextArea(Theme theme) {
  final RSyntaxTextArea editorPane = new RSyntaxTextArea();
  editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE);
  SyntaxScheme scheme = editorPane.getSyntaxScheme();
  scheme.getStyle(Token.RESERVED_WORD).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_KEY);
  scheme.getStyle(Token.OPERATOR).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_KEY);
  scheme.getStyle(Token.VARIABLE).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_VALUE);
  scheme.getStyle(Token.LITERAL_STRING_DOUBLE_QUOTE).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_VALUE);
  scheme.getStyle(Token.COMMENT_EOL).foreground = theme.getColor(ThemeKey.LOG_DETAILS_STACKTRACE_COMMENT);
  editorPane.setBackground(new JTextArea().getBackground());

  Color highlightColor;
  if (theme.themeType().equals(Theme.Type.Light)){
    highlightColor = editorPane.getBackground().darker();
  } else {
    highlightColor = editorPane.getBackground().brighter();
  }
  editorPane.setCurrentLineHighlightColor(highlightColor);
  editorPane.revalidate();
  return editorPane;
}
 
Example #5
Source File: FindBox.java    From Luyten with Apache License 2.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent event) {
	if (textField.getText().length() == 0)
		return;

	RSyntaxTextArea pane = mainWindow.getModel().getCurrentTextArea();
	if (pane == null)
		return;

	SearchContext context = new SearchContext();
	context.setSearchFor(textField.getText());
	context.setMatchCase(mcase.isSelected());
	context.setRegularExpression(regex.isSelected());
	context.setSearchForward(!reverse.isSelected());
	context.setWholeWord(wholew.isSelected());

	if (!SearchEngine.find(pane, context).wasFound()) {
		if (wrap.isSelected()) {
			pane.setSelectionStart(0);
			pane.setSelectionEnd(0);
		} else {
			mainWindow.getLabel().setText("Search Complete");
		}
	}
}
 
Example #6
Source File: MainView.java    From HiJson with Apache License 2.0 6 votes vote down vote up
private RSyntaxTextArea newTextArea(){
//        JTextArea textArea = new JTextArea();
//        textArea.setAutoscrolls(true);
////      textArea.getDocument().addUndoableEditListener(undoMg);
//        textArea.addMouseListener(new TextAreaMouseListener());
        RSyntaxTextArea textArea = new RSyntaxTextArea();
        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
        textArea.setCodeFoldingEnabled(true);
        textArea.setAntiAliasingEnabled(true);
        textArea.setAutoscrolls(true);

        SyntaxScheme scheme = textArea.getSyntaxScheme();
//        scheme.getStyle(Token.COMMENT_KEYWORD).foreground = Color.red;
//      scheme.getStyle(Token.DATA_TYPE).foreground = Color.blue;
        scheme.getStyle(Token.LITERAL_STRING_DOUBLE_QUOTE).foreground = Color.BLUE;
        scheme.getStyle(Token.LITERAL_NUMBER_DECIMAL_INT).foreground = new Color(164, 0, 0);
        scheme.getStyle(Token.LITERAL_NUMBER_FLOAT).foreground = new Color(164, 0, 0);
        scheme.getStyle(Token.LITERAL_BOOLEAN).foreground = Color.RED;
        scheme.getStyle(Token.OPERATOR).foreground = Color.BLACK;
        textArea.revalidate();
        textArea.addMouseListener(new TextAreaMouseListener());
       
        return textArea;
    }
 
Example #7
Source File: FindBox.java    From Luyten with Apache License 2.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	if (textField.getText().length() == 0)
		return;
	RSyntaxTextArea pane = mainWindow.getModel().getCurrentTextArea();
	if (pane == null)
		return;
	SearchContext context = new SearchContext();
	context.setSearchFor(textField.getText());
	context.setMatchCase(mcase.isSelected());
	context.setRegularExpression(regex.isSelected());
	context.setSearchForward(direction);
	context.setWholeWord(wholew.isSelected());

	if (!SearchEngine.find(pane, context).wasFound()) {
		if (wrap.isSelected()) {
			pane.setSelectionStart(0);
			pane.setSelectionEnd(0);
		} else {
			mainWindow.getLabel().setText("Search Complete");
		}
	}

}
 
Example #8
Source File: DesktopSourceCodeEditor.java    From cuba with Apache License 2.0 6 votes vote down vote up
@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 #9
Source File: CodeLinkGenerator.java    From jadx with Apache License 2.0 6 votes vote down vote up
@Nullable
public JumpPosition getJumpLinkAtOffset(RSyntaxTextArea textArea, int offset) {
	try {
		if (jNode.getCodeInfo() == null) {
			return null;
		}
		int sourceOffset = getLinkSourceOffset(textArea, offset);
		if (sourceOffset == -1) {
			return null;
		}
		return getJumpBySourceOffset(textArea, sourceOffset);
	} catch (Exception e) {
		LOG.error("getJumpLinkAtOffset error", e);
		return null;
	}
}
 
Example #10
Source File: ClassViewer.java    From bytecode-viewer with GNU General Public License v3.0 5 votes vote down vote up
public static int getMaxViewLine(RSyntaxTextArea area) {
    Container parent = area.getParent();
    if (parent instanceof JViewport) {
        JViewport viewport = (JViewport) parent;
        int y = viewport.getViewSize().height - viewport.getExtentSize().height;
        int lineHeight = area.getLineHeight();
        return y >= lineHeight ? y / lineHeight : 0;
    }
    return 0;
}
 
Example #11
Source File: SQLTextArea.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jScrollPane2 = new javax.swing.JScrollPane();
    jTextArea1 = new RSyntaxTextArea();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setModal(true);
    setUndecorated(true);

    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane2.setViewportView(jTextArea1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 615, Short.MAX_VALUE)
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(11, Short.MAX_VALUE))
    );

    pack();
}
 
Example #12
Source File: SQLTextArea.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
private void installAutoComplete(List<String> searchStr) {
    ((RSyntaxTextArea) jTextArea1).setCodeFoldingEnabled(true);
    ((RSyntaxTextArea) jTextArea1).setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
    provider = new DefaultCompletionProvider();
    setSearchString(searchStr);
    AutoCompletion ac = new AutoCompletion(provider);
    ac.install(jTextArea1);
}
 
Example #13
Source File: PopUpWindow.java    From SikuliNG with MIT License 5 votes vote down vote up
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 #14
Source File: AbstractLanguageSupport.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor.
 */
protected AbstractLanguageSupport() {
	setDefaultCompletionCellRenderer(null); // Force default
	textAreaToAutoCompletion = new HashMap<RSyntaxTextArea, AutoCompletion>();
	autoCompleteEnabled = true;
	autoActivationEnabled = false;
	autoActivationDelay = 300;
}
 
Example #15
Source File: DyIOchannelWidget.java    From BowlerStudio with GNU General Public License v3.0 5 votes vote down vote up
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 #16
Source File: TextAreaPropertyEditorDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void actionPerformed( final ActionEvent e ) {
  final Object o = syntaxModel.getSelectedKey();
  if ( o instanceof String ) {
    final RSyntaxTextArea textArea = (RSyntaxTextArea) getTextArea();
    textArea.setSyntaxEditingStyle( (String) o );
  }
}
 
Example #17
Source File: TextAreaPropertyEditorDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected JTextArea createTextArea() {
  final RSyntaxTextArea textArea = new RSyntaxTextArea();
  textArea.setBracketMatchingEnabled( true );
  textArea.setSyntaxEditingStyle( RSyntaxTextArea.SYNTAX_STYLE_JAVA );
  textArea.setColumns( 60 );
  textArea.setRows( 20 );
  textArea.getDocument().addDocumentListener( new DocumentUpdateHandler() );
  return textArea;
}
 
Example #18
Source File: TextAreaPropertyEditorDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected Component createContentPane() {
  final JComboBox syntaxBox = new JComboBox( syntaxModel );
  syntaxBox.addActionListener( new SyntaxHighlightAction() );

  final JPanel syntaxSelectionPane = new JPanel();
  syntaxSelectionPane.setLayout( new FlowLayout() );
  syntaxSelectionPane.add( syntaxBox );

  final JPanel contentPane = new JPanel();
  contentPane.setLayout( new BorderLayout() );
  contentPane.add( new RTextScrollPane( 500, 300, (RSyntaxTextArea) getTextArea(), true ), BorderLayout.CENTER );
  contentPane.add( syntaxBox, BorderLayout.NORTH );

  return contentPane;
}
 
Example #19
Source File: JythonLanguageSupport.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void install(RSyntaxTextArea textArea) {

    JythonCompletionProvider prov = getProvider();
    AutoCompletion ac = new JythonAutoCompletion(prov);
    ac.setAutoCompleteEnabled(true);
    ac.setAutoActivationEnabled(true);
    ac.setParameterAssistanceEnabled(isParameterAssistanceEnabled());
    ac.install(textArea);
    installImpl(textArea, ac);

    textArea.setToolTipSupplier(prov);
}
 
Example #20
Source File: AbstractCodeArea.java    From jadx with Apache License 2.0 5 votes vote down vote up
public static RSyntaxTextArea getDefaultArea(MainWindow mainWindow) {
	RSyntaxTextArea area = new RSyntaxTextArea();
	area.setEditable(false);
	area.setCodeFoldingEnabled(false);
	loadCommonSettings(mainWindow, area);
	return area;
}
 
Example #21
Source File: MainWindow.java    From Luyten with Apache License 2.0 5 votes vote down vote up
public void onSaveAsMenu() {
	RSyntaxTextArea pane = this.getModel().getCurrentTextArea();
	if (pane == null)
		return;
	String tabTitle = this.getModel().getCurrentTabTitle();
	if (tabTitle == null)
		return;

	String recommendedFileName = tabTitle.replace(".class", ".java");
	File selectedFile = fileDialog.doSaveDialog(recommendedFileName);
	if (selectedFile != null) {
		fileSaver.saveText(pane.getText(), selectedFile);
	}
}
 
Example #22
Source File: MainWindow.java    From Luyten with Apache License 2.0 5 votes vote down vote up
public void onSelectAllMenu() {
	try {
		RSyntaxTextArea pane = this.getModel().getCurrentTextArea();
		if (pane != null) {
			pane.requestFocusInWindow();
			pane.setSelectionStart(0);
			pane.setSelectionEnd(pane.getText().length());
		}
	} catch (Exception e) {
		Luyten.showExceptionDialog("Exception!", e);
	}
}
 
Example #23
Source File: MainWindow.java    From Luyten with Apache License 2.0 5 votes vote down vote up
public void onFindMenu() {
	try {
		RSyntaxTextArea pane = this.getModel().getCurrentTextArea();
		if (pane != null) {
			if (findBox == null)
				findBox = new FindBox(this);
			findBox.showFindBox();
		}
	} catch (Exception e) {
		Luyten.showExceptionDialog("Exception!", e);
	}
}
 
Example #24
Source File: PaneUpdaterThread.java    From bytecode-viewer with GNU General Public License v3.0 5 votes vote down vote up
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 #25
Source File: MainFrame.java    From jsflight with Apache License 2.0 5 votes vote down vote up
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 #26
Source File: CodeLinkGenerator.java    From jadx with Apache License 2.0 5 votes vote down vote up
@Override
public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, int offset) {
	try {
		if (jNode.getCodeInfo() == null) {
			return null;
		}
		int sourceOffset = getLinkSourceOffset(textArea, offset);
		if (sourceOffset == -1) {
			return null;
		}
		JumpPosition defPos = getJumpBySourceOffset(textArea, sourceOffset);
		if (defPos == null) {
			return null;
		}
		return new LinkGeneratorResult() {
			@Override
			public HyperlinkEvent execute() {
				return new HyperlinkEvent(defPos, HyperlinkEvent.EventType.ACTIVATED, null,
						defPos.getNode().makeLongString());
			}

			@Override
			public int getSourceOffset() {
				return sourceOffset;
			}
		};
	} catch (Exception e) {
		LOG.error("isLinkAtOffset error", e);
		return null;
	}
}
 
Example #27
Source File: RoundMarkErrorStrip.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param textArea The text area we are examining.
 */
public RoundMarkErrorStrip(RSyntaxTextArea textArea) {
    this.textArea = textArea;
    listener = new Listener();
    ToolTipManager.sharedInstance().registerComponent(this);
    setLayout(null); // Manually layout Markers as they can overlap
    addMouseListener(listener);
    setShowMarkedOccurrences(true);
    setShowMarkAll(true);
    setLevelThreshold(ParserNotice.Level.WARNING);
    setFollowCaret(true);
    setCaretMarkerColor(new Color(0x96c5fe));
}
 
Example #28
Source File: RoundMarkErrorStrip.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Overridden so we only start listening for parser notices when this
 * component (and presumably the text area) are visible.
 */
@Override
public void addNotify() {
    super.addNotify();
    textArea.addCaretListener(listener);
    textArea.addPropertyChangeListener(
            RSyntaxTextArea.PARSER_NOTICES_PROPERTY, listener);
    textArea.addPropertyChangeListener(
            RSyntaxTextArea.MARK_OCCURRENCES_PROPERTY, listener);
    textArea.addPropertyChangeListener(
            RSyntaxTextArea.MARKED_OCCURRENCES_CHANGED_PROPERTY, listener);
    textArea.addPropertyChangeListener(
            RSyntaxTextArea.MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, listener);
    refreshMarkers();
}
 
Example #29
Source File: RoundMarkErrorStrip.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void removeNotify() {
    super.removeNotify();
    textArea.removeCaretListener(listener);
    textArea.removePropertyChangeListener(
            RSyntaxTextArea.PARSER_NOTICES_PROPERTY, listener);
    textArea.removePropertyChangeListener(
            RSyntaxTextArea.MARK_OCCURRENCES_PROPERTY, listener);
    textArea.removePropertyChangeListener(
            RSyntaxTextArea.MARKED_OCCURRENCES_CHANGED_PROPERTY, listener);
    textArea.removePropertyChangeListener(
            RSyntaxTextArea.MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, listener);
}
 
Example #30
Source File: RoundMarkErrorStrip.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
public void propertyChange(PropertyChangeEvent e) {

            String propName = e.getPropertyName();

            // If they change whether marked occurrences are visible in editor
            if (RSyntaxTextArea.MARK_OCCURRENCES_PROPERTY.equals(propName)) {
                if (getShowMarkedOccurrences()) {
                    refreshMarkers();
                }
            }

            // If parser notices changed.
            // TODO: Don't update "mark all/occurrences" markers.
            else if (RSyntaxTextArea.PARSER_NOTICES_PROPERTY.equals(propName)) {
                refreshMarkers();
            }

            // If marked occurrences changed.
            // TODO: Only update "mark occurrences" markers, not all of them.
            else if (RSyntaxTextArea.MARKED_OCCURRENCES_CHANGED_PROPERTY.
                    equals(propName)) {
                if (getShowMarkedOccurrences()) {
                    refreshMarkers();
                }
            }

            // If "mark all" occurrences changed.
            // TODO: Only update "mark all" markers, not all of them.
            else if (RTextArea.MARK_ALL_OCCURRENCES_CHANGED_PROPERTY.
                    equals(propName)) {
                if (getShowMarkAll()) {
                    refreshMarkers();
                }
            }

        }