Package org.fife.ui.rsyntaxtextarea

Examples of org.fife.ui.rsyntaxtextarea.RSyntaxTextArea


        this.modelItem = modelItem;
        this.readOnly = readOnly;
    }

    protected void buildUI() {
        editArea = new RSyntaxTextArea(20, 60);

        try {
            Theme theme = Theme.load(XmlSourceEditorView.class.getResourceAsStream(RSYNTAXAREA_THEME));
            theme.apply(editArea);
        } catch (IOException e) {
View Full Code Here


        scriptsPanel = new JPanel();
        scriptsPanel.setLayout(new BoxLayout(scriptsPanel, BoxLayout.Y_AXIS));
        scriptsPanel.setBackground(Color.WHITE);
        int numberOfFields = Math.max(2, currentScripts.size());
        for (int index = 0; index < numberOfFields; index++) {
            RSyntaxTextArea scriptField = SyntaxEditorUtil.createDefaultJavaScriptSyntaxTextArea();
            String scriptName = (index < DEFAULT_SCRIPT_NAMES.length ? DEFAULT_SCRIPT_NAMES[index] : "Page " + (index + 1));
            scriptField.setName(scriptName);
            if (currentScripts.size() > index) {
                scriptField.setText(currentScripts.get(index));
            }
            scriptField.getDocument().addDocumentListener(scriptUpdater);
            scriptFields.add(scriptField);
            InputPanel inputPanel = new InputPanel(scriptName, scriptField);
            inputPanel.setName("Input panel " + (index + 1));
            inputPanels.add(inputPanel);
            scriptsPanel.add(inputPanel);
View Full Code Here

            putValue(LONG_DESCRIPTION, "Adds a new script input field");
        }

        @Override
        public void actionPerformed(ActionEvent e) {
            RSyntaxTextArea scriptField = SyntaxEditorUtil.createDefaultJavaScriptSyntaxTextArea();
            int index = scriptFields.size() + 1;
            String fieldName = "Page " + index;
            scriptField.setName(fieldName);
            scriptField.getDocument().addDocumentListener(scriptUpdater);
            scriptFields.add(scriptField);
            InputPanel inputPanel = new InputPanel(fieldName, scriptField);
            inputPanel.setName("Input panel " + index);
            inputPanels.add(inputPanel);
            scriptsPanel.add(inputPanel, -1);
View Full Code Here

                .addDocumentListener(new JTextComponentEditorModelDocumentListener(editorModel, textArea));
        return new JScrollPane(textArea);
    }

    public JComponent buildXmlEditor(EditorModel editorModel) {
        RSyntaxTextArea xmlEditor = SyntaxEditorUtil.createDefaultXmlSyntaxTextArea();
        RTextScrollPane scrollPane = new RTextScrollPane(xmlEditor);
        xmlEditor = SyntaxEditorUtil.addDefaultActions(xmlEditor, scrollPane, false);
        xmlEditor.setText(editorModel.getEditorText());
        xmlEditor.getDocument().addDocumentListener(new EditorModelDocumentListener(editorModel, xmlEditor));
        UISupport.addPreviewCorner(scrollPane, false);
        return scrollPane;
    }
View Full Code Here

  public UIEditor()
  {
    mScrollPane = this;
    mScrollPane.setLineNumbersEnabled(true);

    mEditor = new RSyntaxTextArea();
    mEditor.setHighlightCurrentLine(false);
    mEditor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 18));
    mEditor.setRoundedSelectionEdges(false);
    SyntaxScheme syntaxSceheme = mEditor.getDefaultSyntaxScheme();
    syntaxSceheme.setStyle(
View Full Code Here

        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);
View Full Code Here

    if (this.textArea!=null) {
      // Enable line numbers our first time through if they give us
      // a text area.
      setLineNumbersEnabled(true);
      if (this.textArea instanceof RSyntaxTextArea) {
        RSyntaxTextArea rsta = (RSyntaxTextArea)this.textArea;
        setFoldIndicatorEnabled(rsta.isCodeFoldingEnabled());
      }
    }

    setBorder(new GutterBorder(0, 0, 0, 1)); // Assume ltr
View Full Code Here

      }
      textArea.addComponentListener(this);
      textArea.getDocument().addDocumentListener(this);
      textArea.addPropertyChangeListener(this);
      if (textArea instanceof RSyntaxTextArea) {
        RSyntaxTextArea rsta = (RSyntaxTextArea)textArea;
        rsta.addActiveLineRangeListener(this);
        rsta.getFoldManager().addPropertyChangeListener(this);
      }
      installed = true;
    }
View Full Code Here

    public void uninstall() {
      if (installed) {
        textArea.removeComponentListener(this);
        textArea.getDocument().removeDocumentListener(this);
        if (textArea instanceof RSyntaxTextArea) {
          RSyntaxTextArea rsta = (RSyntaxTextArea)textArea;
          rsta.removeActiveLineRangeListener(this);
          rsta.getFoldManager().removePropertyChangeListener(this);
        }
        installed = false;
      }
    }
View Full Code Here

  private Fold findOpenFoldClosestTo(Point p) {

    Fold fold = null;

    RSyntaxTextArea rsta = (RSyntaxTextArea)textArea;
    if (rsta.isCodeFoldingEnabled()) { // Should always be true
      int offs = rsta.viewToModel(p); // TODO: Optimize me
      if (offs>-1) {
        try {
          int line = rsta.getLineOfOffset(offs);
          FoldManager fm = rsta.getFoldManager();
          fold = fm.getFoldForLine(line);
          if (fold==null) {
            fold = fm.getDeepestOpenFoldContaining(offs);
          }
        } catch (BadLocationException ble) {
View Full Code Here

TOP

Related Classes of org.fife.ui.rsyntaxtextarea.RSyntaxTextArea

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.