org.fife.ui.rsyntaxtextarea.SyntaxConstants Java Examples

The following examples show how to use org.fife.ui.rsyntaxtextarea.SyntaxConstants. 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: GuiUtil.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
private static TextEditor addNewTextEditor(String title, JTabbedPane tabbedPanel) {
    final TextEditor tab = new TextEditor(tabbedPanel, title);
    tabbedPanel.add(tab, title);
    tabbedPanel.setSelectedComponent(tab);
    //tab.setTextFont(_font);
    tab.getTextArea().setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PYTHON);
    tab.getTextArea().discardAllEdits();
    tab.getTextArea().setDirty(false);
    tab.setTitle(title);
    ButtonTabComponent btc = new ButtonTabComponent(tabbedPanel);
    JButton button = btc.getTabButton();
    button.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //FrmTextEditor.this.closeFile(tab);
        }
    });
    tabbedPanel.setTabComponentAt(tabbedPanel.indexOfComponent(tab), btc);

    return tab;
}
 
Example #2
Source File: ConsolePanel.java    From zap-extensions with Apache License 2.0 6 votes vote down vote up
private static String getSyntaxForScript(String engine) {
    String engineLc = engine.toLowerCase(Locale.ROOT);
    if (engineLc.startsWith("clojure")) {
        return SyntaxConstants.SYNTAX_STYLE_CLOJURE;
    } else if (engineLc.startsWith("groovy")) {
        return SyntaxConstants.SYNTAX_STYLE_GROOVY;
    } else if (engineLc.startsWith("ecmacript")) {
        return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
    } else if (engineLc.startsWith("javascript")) {
        return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
    } else if (engineLc.startsWith("python")) {
        return SyntaxConstants.SYNTAX_STYLE_PYTHON;
    } else if (engineLc.startsWith("ruby")) {
        return SyntaxConstants.SYNTAX_STYLE_RUBY;
    } else if (engineLc.startsWith("scala")) {
        return SyntaxConstants.SYNTAX_STYLE_SCALA;
    } else {
        return SyntaxConstants.SYNTAX_STYLE_NONE;
    }
}
 
Example #3
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 #4
Source File: FrmTextEditor.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
private TextEditor addNewTextEditor(String title) {
    final TextEditor tab = new TextEditor(this.jTabbedPane1, title);
    this.jTabbedPane1.add(tab, title);
    this.jTabbedPane1.setSelectedComponent(tab);
    tab.setTextFont(_font);
    if (this._scriptLanguage.equals("Groovy")) {
        tab.getTextArea().setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY);
    } else {
        tab.getTextArea().setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PYTHON);
    }
    tab.getTextArea().discardAllEdits();
    tab.getTextArea().setDirty(false);
    tab.setTitle(title);
    ButtonTabComponent btc = new ButtonTabComponent(this.jTabbedPane1);
    JButton button = btc.getTabButton();
    button.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FrmTextEditor.this.closeFile(tab);
        }
    });
    this.jTabbedPane1.setTabComponentAt(this.jTabbedPane1.indexOfComponent(tab), btc);

    return tab;
}
 
Example #5
Source File: RSyntaxScriptEditor.java    From rest-client with Apache License 2.0 6 votes vote down vote up
@Override
public final void setSyntax(TextEditorSyntax syntax) {
    switch(syntax) {
        case GROOVY:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY);
            break;
        case XML:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
            break;
        case JSON:
        case JS:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
            break;
        case HTML:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);
            break;
        case CSS:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CSS);
            break;
        default:
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
    }
}
 
Example #6
Source File: PmdDataSourceEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final ScriptEngineFactory script ) {
  if ( script == null ) {
    return SyntaxConstants.SYNTAX_STYLE_NONE;
  }

  final String language = script.getLanguageName();
  if ( "ECMAScript".equalsIgnoreCase( language )
     || "js".equalsIgnoreCase( language )
     || "rhino".equalsIgnoreCase( language )
     || "javascript".equalsIgnoreCase( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "groovy".equalsIgnoreCase( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example #7
Source File: ScriptableDataSourceEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example #8
Source File: TextAreaPropertyEditorDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
protected void init() {
  syntaxModel = new KeyedComboBoxModel<String, String>();
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_NONE ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.None" ) );
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_JAVA ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Java" ) );
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.JavaScript" ) );
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_GROOVY ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Groovy" ) );
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_HTML ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Html" ) );
  syntaxModel
    .add( ( SyntaxConstants.SYNTAX_STYLE_CSS ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.CSS" ) );
  syntaxModel
    .add( ( SyntaxConstants.SYNTAX_STYLE_SQL ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.SQL" ) );
  syntaxModel
    .add( ( SyntaxConstants.SYNTAX_STYLE_XML ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.XML" ) );
  syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_PYTHON ),
    UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Python" ) );
  syntaxModel
    .add( ( SyntaxConstants.SYNTAX_STYLE_TCL ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.TCL" ) );

  super.init();
}
 
Example #9
Source File: BeanShellScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example #10
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 #11
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 #12
Source File: BSFScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example #13
Source File: JResource.java    From jadx with Apache License 2.0 6 votes vote down vote up
@Override
public String getSyntaxName() {
	if (resFile == null) {
		return null;
	}
	switch (resFile.getType()) {
		case CODE:
			return super.getSyntaxName();

		case MANIFEST:
		case XML:
			return SyntaxConstants.SYNTAX_STYLE_XML;

		default:
			String syntax = getSyntaxByExtension(resFile.getName());
			if (syntax != null) {
				return syntax;
			}
			return super.getSyntaxName();
	}
}
 
Example #14
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 #15
Source File: JSyntaxTextArea.java    From jmeter-plugins-webdriver with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the default syntax highlighting text area. The following are set:
 * <ul>
 * <li>setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)</li>
 * <li>setCodeFoldingEnabled(true)</li>
 * <li>setAntiAliasingEnabled(true)</li>
 * <li>setLineWrap(true)</li>
 * <li>setWrapStyleWord(true)</li>
 * </ul>
 * 
 * @param rows
 *            The number of rows for the text area
 * @param cols
 *            The number of columns for the text area
 * @param disableUndo
 *            true to disable undo manager, defaults to false
 * @deprecated use {@link #getInstance(int, int, boolean)} instead
 */
@Deprecated
public JSyntaxTextArea(int rows, int cols, boolean disableUndo) {
    super(rows, cols);
    super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    super.setCodeFoldingEnabled(CODE_FOLDING);
    super.setAntiAliasingEnabled(true);
    super.setLineWrap(LINE_WRAP);
    super.setWrapStyleWord(WRAP_STYLE_WORD);
    this.disableUndo = disableUndo;
    if (USER_FONT_FAMILY != null) {
        int fontSize = USER_FONT_SIZE > 0 ? USER_FONT_SIZE : getFont().getSize();
        setFont(new Font(USER_FONT_FAMILY, Font.PLAIN, fontSize));
        if (log.isDebugEnabled()) {
            log.debug("Font is set to: {}", getFont());
        }
    }
    if(disableUndo) {
        // We need to do this to force recreation of undoManager which
        // will use the disableUndo otherwise it would always be false
        // See BUG 57440
        discardAllEdits();
    }
}
 
Example #16
Source File: SqlFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_SQL; }
    };
}
 
Example #17
Source File: CssFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() {
            return SyntaxConstants.SYNTAX_STYLE_CSS;
        }
    };
}
 
Example #18
Source File: DtdFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_DTD; }
    };
}
 
Example #19
Source File: JCEditor.java    From JCEditor with GNU General Public License v2.0 5 votes vote down vote up
public void actionPerformed(ActionEvent ev) {
	at = new AreaDeTexto();
	lista.add(at);
	arquivos.addTab("Sem nome", at);
	arquivos.setSelectedIndex(lista.size() - 1);

	int i = arquivos.getSelectedIndex();
	arquivos.setTabComponentAt(i, new ButtonTabComponent(arquivos, lista, arquivosAbertos));

	lista.get(arquivos.getSelectedIndex()).getRSyntax().setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
	arquivos.setToolTipTextAt(arquivos.getSelectedIndex(), "Sem nome");
	linguagem.setText(lista.get(arquivos.getSelectedIndex()).getLinguagem() + "   ");
	bg2.clearSelection();
	carregarTema(sTema);
}
 
Example #20
Source File: ResourcesView.java    From nordpos with GNU General Public License v3.0 5 votes vote down vote up
public void writeValueEOF() {
    m_oId = null;
    m_jName.setText(null);
    m_ResourceModel.setSelectedItem(null);
    m_jText.setText(null);
    m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);    
    m_jImage.setImage(null);
    m_jName.setEnabled(false);
    m_jType.setEnabled(false);
    m_jText.setEnabled(false);
    m_jImage.setEnabled(false);
}
 
Example #21
Source File: ResourcesView.java    From nordpos with GNU General Public License v3.0 5 votes vote down vote up
public void writeValueInsert() {
    m_oId = null;
    m_jName.setText(null);
    m_jName.setBackground(COLOR_MANDATORY_FIELD);
    m_ResourceModel.setSelectedItem(ResourceType.TEXT);
    m_jText.setText(null);
    m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);         
    m_jImage.setImage(null);
    m_jName.setEnabled(true);
    m_jType.setEnabled(true);
    m_jText.setEnabled(true);
    m_jImage.setEnabled(true);
}
 
Example #22
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 #23
Source File: BSFScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public BSFScriptingExpressionEditor() {
  setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_JAVA );

  languageField = new SmartComboBox( new DefaultComboBoxModel( InternalBSFManager.getRegisteredLanguages() ) );
  languageField.getModel().addListDataListener( new UpdateLanguageHandler() );

  final JPanel panel = new JPanel();
  panel.setLayout( new VerticalLayout( 5, VerticalLayout.BOTH ) );
  panel.add( new JLabel( EditorExpressionsMessages.getString( "BSFScriptingExpressionEditor.Language" ) ) );
  panel.add( languageField );

  getPanel().add( panel, BorderLayout.NORTH );
}
 
Example #24
Source File: RolesView.java    From nordpos with GNU General Public License v3.0 5 votes vote down vote up
/** Creates new form RolesEditor */
public RolesView(DirtyManager dirty) {
    initComponents();
    
    m_jName.getDocument().addDocumentListener(dirty);
    m_jText.getDocument().addDocumentListener(dirty);
    
    m_jText.setAntiAliasingEnabled(true);
    m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);            
    
    writeValueEOF();
}
 
Example #25
Source File: HtmlFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_HTML; }
    };
}
 
Example #26
Source File: JavascriptFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT; }
    };
}
 
Example #27
Source File: JsonFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_JSON; }
    };
}
 
Example #28
Source File: XmlBasedFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_XML; }
    };
}
 
Example #29
Source File: JspFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_JSP; }
    };
}
 
Example #30
Source File: PropertiesFileTreeNodeFactoryProvider.java    From jd-gui with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends JComponent & UriGettable> T createPage(API api) {
    return (T)new TextFileTreeNodeFactoryProvider.Page(entry) {
        @Override public String getSyntaxStyle() {
            return SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE;
        }
    };
}