/** * Creates a JEdit text area. * * @param viewDescriptor * the component view descriptor. * @param language * the language to add syntax highlighting for. * @return the created text area. */ protected JEditTextArea createJEditTextArea(IPropertyViewDescriptor viewDescriptor, String language) { JEditTextArea textArea = new JEditTextArea(); try { textArea.setTokenMarker( (TokenMarker) Class.forName("org.syntax.jedit.tokenmarker." + language + "TokenMarker").newInstance()); } catch (InstantiationException | ClassNotFoundException | IllegalAccessException ex) { // Nothing to do. just don't colorize. } return textArea; }
/** * Creates a JEdit text area. * * @param language * the language to add syntax highlighting for. * @return the created text area. */ protected JEditTextArea createJEditTextArea(String language) { JEditTextArea textArea = new JEditTextArea(); try { textArea.setTokenMarker((TokenMarker) Class.forName( "org.syntax.jedit.tokenmarker." + language + "TokenMarker") .newInstance()); } catch (InstantiationException ex) { // Nothing to do. just don't colorize. } catch (IllegalAccessException ex) { // Nothing to do. just don't colorize. } catch (ClassNotFoundException ex) { // Nothing to do. just don't colorize. } return textArea; }
/** * {@inheritDoc} */ @Override protected Object createBasicObject(Anything args) { JEditTextArea textArea = new JEditTextArea(); String language = args.get(JEditTextAreaConstants.LANGUAGE_KEY, ""); if (language != null && language.length() > 0) { try { textArea.setTokenMarker((TokenMarker) Class.forName( "org.syntax.jedit.tokenmarker." + language + "TokenMarker") .newInstance()); } catch (InstantiationException ex) { // Nothing to do. just don't colorize. } catch (IllegalAccessException ex) { // Nothing to do. just don't colorize. } catch (ClassNotFoundException ex) { // Nothing to do. just don't colorize. } } return textArea; }
/** * {@inheritDoc} */ @Override protected Object createBasicObject(Anything args) { JEditTextArea textArea = new JEditTextArea(); String language = args.get(JEditTextAreaConstants.LANGUAGE_KEY, ""); if (language != null && language.length() > 0) { try { textArea.setTokenMarker((TokenMarker) Class.forName( "org.syntax.jedit.tokenmarker." + language + "TokenMarker") .newInstance()); } catch (InstantiationException ex) { // Nothing to do. just don't colorize. } catch (IllegalAccessException ex) { // Nothing to do. just don't colorize. } catch (ClassNotFoundException ex) { // Nothing to do. just don't colorize. } } return textArea; }
editor.setTokenMarker(new JavaTokenMarker()); } else if ("xml".equalsIgnoreCase(ext)) { editor.setTokenMarker(new XMLTokenMarker());
editor.setTokenMarker(new JavaTokenMarker()); } else if ("xml".equalsIgnoreCase(ext)) { editor.setTokenMarker(new XMLTokenMarker());
@Override public void setSyntax(Editor.EditorSyntaxConstant editorSyntax) { TokenMarker tokenMarker = null; if (editorSyntax.equals(Editor.EditorSyntaxConstant.JAVA)) { tokenMarker = new JavaTokenMarker(); } else if (editorSyntax.equals(Editor.EditorSyntaxConstant.XML)) { tokenMarker = new XMLTokenMarker(); } else { log.warn("Syntax '" + editorSyntax.getName() + "' is not yet supported by JEditEditor"); } if (tokenMarker != null) { editor.setTokenMarker(tokenMarker); } }
@Override public void setSyntax(Editor.EditorSyntaxConstant editorSyntax) { TokenMarker tokenMarker = null; if (editorSyntax.equals(Editor.EditorSyntaxConstant.JAVA)) { tokenMarker = new JavaTokenMarker(); } else if (editorSyntax.equals(Editor.EditorSyntaxConstant.XML)) { tokenMarker = new XMLTokenMarker(); } else { log.warn("Syntax '" + editorSyntax.getName() + "' is not yet supported by JEditEditor"); } if (tokenMarker != null) { editor.setTokenMarker(tokenMarker); } }
scriptText.setTokenMarker(new JavaTokenMarker()); scriptText.setCaretPosition(0); scriptText.setPreferredSize(new Dimension(0, 0));
scriptText.setTokenMarker(new JavaTokenMarker()); scriptText.setCaretPosition(0); scriptText.setPreferredSize(new Dimension(0, 0));
scriptText.setTokenMarker(new JavaTokenMarker()); scriptText.setCaretPosition(0); scriptText.setPreferredSize(new Dimension(0, 0));
scriptText.setTokenMarker(new JavaTokenMarker()); scriptText.setCaretPosition(0); scriptText.setPreferredSize(new Dimension(0, 0));