当前位置: 首页>>代码示例>>Java>>正文


Java RSyntaxTextArea.setSyntaxEditingStyle方法代码示例

本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setSyntaxEditingStyle方法的典型用法代码示例。如果您正苦于以下问题:Java RSyntaxTextArea.setSyntaxEditingStyle方法的具体用法?Java RSyntaxTextArea.setSyntaxEditingStyle怎么用?Java RSyntaxTextArea.setSyntaxEditingStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fife.ui.rsyntaxtextarea.RSyntaxTextArea的用法示例。


在下文中一共展示了RSyntaxTextArea.setSyntaxEditingStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: StepDialog

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public StepDialog(AgentDebuggerFrame f, String text, String type) {
    super(f, true);
    this.f = f;
    setLayout(new BorderLayout());
    ta = new RSyntaxTextArea();
    ta.setSyntaxEditingStyle(type);
    ta.setHyperlinksEnabled(false);
    ta.setText(text);
    ta.setCaretPosition(0);
    RTextScrollPane sp = new RTextScrollPane(ta);
    sp.setIconRowHeaderEnabled(true);
    add(BorderLayout.CENTER, sp);
    add(createButtonPanel(), BorderLayout.SOUTH);
    setSize(new Dimension(800, 600));
    setBounds(new Rectangle(getSize()));
    setPreferredSize(getSize());
    WindowUtil.centerOnParent(this);
}
 
开发者ID:intuit,项目名称:Tank,代码行数:19,代码来源:StepDialog.java

示例2: newTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
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;
    }
 
开发者ID:nblookup,项目名称:HiJson,代码行数:25,代码来源:MainView.java

示例3: createBottomPanel

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
/**
 * @param debuggerActions
 * @param loadChooser
 * @return
 */
static Component createBottomPanel(final AgentDebuggerFrame frame) {
    JPanel panel = new JPanel(new BorderLayout());

    RSyntaxTextArea loggerTA = new RSyntaxTextArea();
    frame.setLoggerTA(loggerTA);
    loggerTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
    loggerTA.setHyperlinksEnabled(false);
    loggerTA.setEditable(false);
    loggerTA.setHighlightCurrentLine(false);
    JPopupMenu popupMenu = new JPopupMenu();
    popupMenu.add(frame.getDebuggerActions().getSaveLogAction());
    popupMenu.add(frame.getDebuggerActions().getClearLogOutputAction());
    loggerTA.setPopupMenu(popupMenu);

    RTextScrollPane sp = new RTextScrollPane(loggerTA);
    sp.setIconRowHeaderEnabled(false);
    sp.getGutter().setBookmarkingEnabled(false);

    panel.add(sp, BorderLayout.CENTER);

    DebuggerAppender.addTextArea(loggerTA);

    return panel;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:30,代码来源:PanelBuilder.java

示例4: displayJavaConfigInfo

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public static void displayJavaConfigInfo() {
    JFrame dframe = new JFrame("Java Runtime Information");
    final RSyntaxTextArea jt = new RSyntaxTextArea();

    jt.setFont(new Font(GlobalValues.paneFontName, Font.PLAIN, GlobalValues.paneFontSize));

    jt.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    jt.setCodeFoldingEnabled(true);

    StringBuilder sb = new StringBuilder();
    for (Map.Entry e : System.getProperties().entrySet()) {
        String se = (String) e.getKey();
        if (se.startsWith("java")) {
            //System.out.println("se = "+e.toString());
            sb.append(e.toString() + "\n");
        }
    }
    jt.setText(sb.toString());

    RTextScrollPane jp = new RTextScrollPane(jt);
    dframe.add(jp);
    dframe.setLocation(200, 200);
    dframe.setSize(400, 400);
    dframe.setVisible(true);

}
 
开发者ID:scalalab,项目名称:scalalab,代码行数:27,代码来源:JavaConfigInfo.java

示例5: CustomCodeSyntaxPane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public CustomCodeSyntaxPane() {

		panel = new JPanel(new BorderLayout());
		textArea = new RSyntaxTextArea();
		textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
		textArea.setAntiAliasingEnabled(true);
		textArea.setCodeFoldingEnabled(true);
		textArea.setFont(DerivedConfig.getPanelContentFont());

		// setup autocompletion
		for (String word : getAutocompletionStrings()) {
			provider.addCompletion(new BasicCompletion(provider, word));
		}
		new AutoCompletion(provider).install(textArea);

		scrollPane = new RTextScrollPane(textArea);
		scrollPane.setFoldIndicatorEnabled(true);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		panel.add(scrollPane);
		textArea.getDocument().putProperty(PlainDocument.tabSizeAttribute, 3); // Reduce tab size
	}
 
开发者ID:umlet,项目名称:umlet,代码行数:23,代码来源:CustomCodeSyntaxPane.java

示例6: TextEditorDemo

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public TextEditorDemo() {

          JPanel cp = new JPanel(new BorderLayout());

          AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory)TokenMakerFactory.getDefaultInstance();
          atmf.putMapping("text/c3dg", "org.konte.ui.KonteRSTATokenMaker");

          RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
          textArea.setSyntaxEditingStyle("text/c3dg");
          textArea.setCodeFoldingEnabled(true);
          RTextScrollPane sp = new RTextScrollPane(textArea);
          cp.add(sp);

          setContentPane(cp);
          setTitle("Text Editor Demo");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();
          setLocationRelativeTo(null);

       }
 
开发者ID:pvto,项目名称:konte-art,代码行数:21,代码来源:KonteRSTATokenMaker.java

示例7: buildCodePane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
/**
 * Builds the code pane
 *
 * @return JComponent
 */
private JComponent buildCodePane() {
    textArea = new RSyntaxTextArea(20, 60);
    textArea.setSyntaxEditingStyle(syntaxStyle);
    textArea.setCodeFoldingEnabled(true);
    try {
        Theme theme = Theme.load(getClass().getResourceAsStream("CodeEditorTheme.xml"));
        theme.apply(textArea);
    } catch (IOException e) {
        ExceptionHandler.get().handle(e);
    }
    return new RTextScrollPane(textArea);
}
 
开发者ID:VISNode,项目名称:VISNode,代码行数:18,代码来源:CodeEditor.java

示例8: getHtmlPane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public static RSyntaxTextArea getHtmlPane() {
	/*
	 * JEditorPane htmlPane = new JEditorPane();
	 * htmlPane.setBackground(Color.WHITE);
	 * htmlPane.setForeground(Color.BLACK); Font font = new
	 * Font(Font.SANS_SERIF, Font.PLAIN, 20); htmlPane.setFont(font);
	 */
	RSyntaxTextArea textArea = new RSyntaxTextArea();
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
	textArea.setCodeFoldingEnabled(true);
	Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 16);
	textArea.setFont(font);
	return textArea;
}
 
开发者ID:csanuragjain,项目名称:APKRepatcher,代码行数:15,代码来源:APKRepatcher.java

示例9: createSyntaxTextField

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private RSyntaxTextArea createSyntaxTextField()
{
	RSyntaxTextArea area = new RSyntaxTextArea();
	area.setRows(3);
	area.setLineWrap(true);
	area.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
	area.setHighlightCurrentLine(false);
	return area;
}
 
开发者ID:equella,项目名称:Equella,代码行数:10,代码来源:ReplicatedPlugin.java

示例10: createEditorScrollPane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
/**
 * Constructs an editor scroll pane
 * @param code the set code in the editor pane before the user makes edits
 * @return the constructed scroll pane
 */
public JScrollPane createEditorScrollPane(String code)
{
	editorPane = new RSyntaxTextArea(code);
	editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    editorPane.setCodeFoldingEnabled(true);
	try 
	{
		spellParser = SpellingParser.createEnglishSpellingParser(new File(ArJClassEditor.class.getProtectionDomain().getCodeSource().getLocation().getPath() + "english_dic.zip"), true);
	} catch (IOException ioe) {}
	if (spellParser != null) 
	{
		try 
		{
			File userDict= File.createTempFile("spellDemo", ".txt");
			spellParser.setUserDictionary(userDict);
		} 
		catch (Exception e) {}
		SwingUtilities.invokeLater(
				new Runnable() 
				{
					@Override
					public void run() 
					{
						editorPane.addParser(spellParser);
					}
				}
		);
	}
	JScrollPane editorScrollPane = new JScrollPane(editorPane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	return editorScrollPane;
}
 
开发者ID:arjunvnair,项目名称:ArJ-class-editor,代码行数:37,代码来源:ArJClassEditor.java

示例11: createUIComponents

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private void createUIComponents() {
    textArea = new RSyntaxTextArea();
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON);
    textArea.setCodeFoldingEnabled(true);
    scrollView = new JScrollPane(textArea);
    try {
        Theme theme = Theme.load(getClass().getResourceAsStream(
                "/org/fife/ui/rsyntaxtextarea/themes/monokai.xml"));
        theme.apply(textArea);
    } catch (IOException ioe) {
        ioe.printStackTrace();
    }
}
 
开发者ID:robohorse,项目名称:RoboPOJOGenerator,代码行数:14,代码来源:GeneratorVew.java

示例12: addTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private void addTextArea() {
	textArea = new RSyntaxTextArea();
	textArea.setHighlightCurrentLine(true);
	textArea.setAnimateBracketMatching(true);
	textArea.setAntiAliasingEnabled(true);
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);

	scrollBar = new RTextScrollPane(textArea);
	scrollBar.setBorder(null);
	scrollBar.setLineNumbersEnabled(true);
	scrollBar.setViewportView(textArea);

	this.getContentPane().add(scrollBar);
}
 
开发者ID:cristian-henrique,项目名称:HTML-Viewer,代码行数:15,代码来源:HTMLViewer.java

示例13: AutoCompleteDemo

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public AutoCompleteDemo() {

		JPanel contentPane = new JPanel(new BorderLayout());
		RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
		textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
		textArea.setCodeFoldingEnabled(true);
		contentPane.add(new RTextScrollPane(textArea));

		// A CompletionProvider is what knows of all possible completions, and
		// analyzes the contents of the text area at the caret position to
		// determine what completion choices should be presented. Most instances
		// of CompletionProvider (such as DefaultCompletionProvider) are
		// designed
		// so that they can be shared among multiple text components.
		CompletionProvider provider = createCompletionProvider();

		// An AutoCompletion acts as a "middle-man" between a text component
		// and a CompletionProvider. It manages any options associated with
		// the auto-completion (the popup trigger key, whether to display a
		// documentation window along with completion choices, etc.). Unlike
		// CompletionProviders, instances of AutoCompletion cannot be shared
		// among multiple text components.
		AutoCompletion ac = new AutoCompletion(provider);
		ac.setParameterAssistanceEnabled(true);
		ac.setAutoCompleteEnabled(true);
		ac.install(textArea);
		
		setContentPane(contentPane);
		setTitle("AutoComplete Demo");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		pack();
		setLocationRelativeTo(null);
		
	}
 
开发者ID:curiosag,项目名称:ftc,代码行数:35,代码来源:AutoCompleteDemo.java

示例14: PrologSourceEditor

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public PrologSourceEditor() {
  super("Editor", new RSyntaxTextArea());

  final RSyntaxTextArea theEditor = (RSyntaxTextArea) this.editor;
  theEditor.setTabsEmulated(true);
  theEditor.setSyntaxEditingStyle("text/jprol");
  theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).foreground = Color.RED.darker();
  theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).font = theEditor.getFont().deriveFont(Font.BOLD);
  
  theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Z"), "none");
  theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Y"), "none");
  
  theEditor.setAntiAliasingEnabled(true);
  theEditor.setBracketMatchingEnabled(true);
  theEditor.setCodeFoldingEnabled(true);

  removePropertyFromList("EdWordWrap");

  editor.setForeground(Color.BLACK);
  editor.setBackground(Color.WHITE);
  editor.setCaretColor(Color.BLACK);
  editor.setFont(new Font("Courier", Font.BOLD, 14));

  editor.setVisible(true);

  setEnabled(true);

  this.undoManager = new RUndoManager(theEditor);
}
 
开发者ID:raydac,项目名称:jprol,代码行数:30,代码来源:PrologSourceEditor.java

示例15: configureScriptTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
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);
}
 
开发者ID:d0k1,项目名称:jsflight,代码行数:14,代码来源:MainFrame.java


注:本文中的org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setSyntaxEditingStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。