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


Java RTextScrollPane.setLineNumbersEnabled方法代码示例

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


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

示例1: createTextComponentImpl

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
@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;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:DesktopSourceCodeEditor.java

示例2: addTextArea

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的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

示例3: QueryEditor

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public QueryEditor(SyntaxElementSource syntaxElementSource, CompletionsSource completionsSource,
		ClientSettings clientSettings) {
	Check.notNull(syntaxElementSource);

	this.syntaxElementSource = syntaxElementSource;
	this.completionsSource = completionsSource;
	this.clientSettings = clientSettings;

	queryText = createTextArea();
	queryText.addParser(new GftParser(syntaxElementSource, onStartParsing, onFinshParsing));
	queryText.setMarkOccurrences(false);
	queryText.setHighlightCurrentLine(clientSettings.highlightCurrentLine);

	queryText.setParserDelay(700);
	waitStateDisplay = new WaitStateDisplay(queryText);

	scrollPane = new RTextScrollPane(queryText, false);
	scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	Gutter gutter = scrollPane.getGutter();
	gutter.setBookmarkingEnabled(true);
	scrollPane.setIconRowHeaderEnabled(true);
	scrollPane.setLineNumbersEnabled(clientSettings.lineNumbersEnabled);

	setTheme(clientSettings.editorThemeXml);

	URL url = getClass().getResource(Const.resourcePath + "bookmark.png");

	gutter.setBookmarkIcon(new ImageIcon(url));

	getContentPane().add(scrollPane);
	ErrorStrip errorStrip = new ErrorStrip(queryText);

	getContentPane().add(errorStrip, BorderLayout.LINE_END);

	setCompletionProvider();
	setTokenMaker();
	queryText.setSyntaxEditingStyle(Const.languageId);

	registerForLongOperationEvent();
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:41,代码来源:QueryEditor.java

示例4: configureScriptTextArea

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的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

示例5: SyntaxSnippetEditor

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public SyntaxSnippetEditor() {
    textArea = new RSyntaxTextArea(20, 20);
    textArea.setCodeFoldingEnabled(true);
    scrollPane = new RTextScrollPane(textArea);
    scrollPane.setLineNumbersEnabled(false);
    scrollPane.setIconRowHeaderEnabled(false);
    GuiUtil.removeBorder(scrollPane);
}
 
开发者ID:massimozappino,项目名称:tagmycode-java-plugin-framework,代码行数:9,代码来源:SyntaxSnippetEditor.java

示例6: RSyntaxSourceEditor

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public RSyntaxSourceEditor()
{
  textArea = new RSyntaxTextArea();
  textArea.setOpaque( true );
  textArea.setBracketMatchingEnabled( true );
  textArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_HTML );
  scroller = new RTextScrollPane( textArea );
  scroller.setLineNumbersEnabled( true );
}
 
开发者ID:OpenIndex,项目名称:OpenIndex-SHEF,代码行数:10,代码来源:RSyntaxSourceEditor.java

示例7: ScriptEditField

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public ScriptEditField() {
	scriptDoc = new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
	
	scriptTextArea = new RSyntaxTextArea(scriptDoc);
	scriptTextArea.setAutoIndentEnabled(true);
	scriptTextArea.setAnimateBracketMatching(true);
	scriptTextArea.setCodeFoldingEnabled(true);

	scriptScroll = new RTextScrollPane(scriptTextArea);
	scriptScroll.setLineNumbersEnabled(true);  
	
}
 
开发者ID:cristal-ise,项目名称:gui,代码行数:13,代码来源:ScriptEditField.java

示例8: SimonkEditorPanel

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public SimonkEditorPanel(KKMulticopterFlashTool parent) {
	this.parent = parent;
	
	//create the CellContraints
	cc  = new CellConstraints();
			
	// create the Layout for Panel this
	String panelColumns = "fill:pref:grow";
	String panelRows = "pref,3dlu,fill:pref:grow,3dlu,pref";
	FormLayout formLayout = new FormLayout(panelColumns, panelRows);
	
	this.setLayout(formLayout);

	githubPanel = new GithubPanel("sim-/tgy");
	githubPanel.addGithubPanelListener(this);
			
	tgyTextArea = new RSyntaxTextArea(20, 60);
	tgyTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
	tgyTextArea.setCodeFoldingEnabled(true);
	tgyTextArea.setAntiAliasingEnabled(true);
	RTextScrollPane tgyEditorPane = new RTextScrollPane(tgyTextArea);
	tgyEditorPane.setFoldIndicatorEnabled(true);
	tgyEditorPane.setLineNumbersEnabled(true);
	
	incTextArea = new RSyntaxTextArea(20, 60);
	incTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
	incTextArea.setCodeFoldingEnabled(true);
	incTextArea.setAntiAliasingEnabled(true);
	RTextScrollPane incEditorPane = new RTextScrollPane(incTextArea);
	incEditorPane.setFoldIndicatorEnabled(true);
	incEditorPane.setLineNumbersEnabled(true);
	
	tabs = new JTabbedPane();
	tabs.add("empty",tgyEditorPane);
	tabs.add("empty",incEditorPane);
	
	saveButton = new JButton(_("save"));
	saveButton.addActionListener(this);
	saveButton.setEnabled(false);
	
	compileButton = new JButton(_("compile"));
	compileButton.addActionListener(this);
	compileButton.setEnabled(false);
	
	saveCompileButton = new JButton(_("save") + " & " +_("compile"));
	saveCompileButton.addActionListener(this);
	saveCompileButton.setEnabled(false);
	
	bar = new ButtonBarBuilder2();
	bar.addButton(saveButton);
	bar.addButton(compileButton);
	bar.addGlue();
	bar.addUnrelatedGap();
	bar.addButton(saveCompileButton);
	
	this.add(githubPanel, cc.xy(1, 1));
	this.add(tabs, cc.xy(1, 3));
	this.add(bar.getPanel(), cc.xy(1, 5));

	try {
		Theme theme = Theme.load(SimonkEditorPanel.class.getResourceAsStream("/de/lazyzero/kkMulticopterFlashTool/gui/widgets/dark.xml"));
		theme.apply(tgyTextArea);
		theme.apply(incTextArea);
	} catch (IOException ioe) { // Never happens
		ioe.printStackTrace();
	}
}
 
开发者ID:lazyzero,项目名称:kkMulticopterFlashTool,代码行数:68,代码来源:SimonkEditorPanel.java

示例9: addTextArea

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void addTextArea() {
	jtfFilter = new JTextField();
	findButton = new JButton("Next word");
	textArea = new RSyntaxTextArea();
	textArea.setHighlightCurrentLine(true);
	textArea.setAnimateBracketMatching(true);
	textArea.setAntiAliasingEnabled(true);
	textArea.setEditable(false);
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);

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

	this.getContentPane().add(scrollBar);

	JPanel panel = new JPanel(new BorderLayout());
	panel.add(new JLabel("Specify a word to match:"), BorderLayout.WEST);
	panel.add(jtfFilter, BorderLayout.CENTER);
	panel.add(findButton, BorderLayout.EAST);
	add(panel, BorderLayout.SOUTH);

	findButton.addActionListener(e -> {
		String find = jtfFilter.getText().toLowerCase();
		textArea.requestFocusInWindow();
		if (!Strings.isBlank(find)) {
			Document document = textArea.getDocument();
			int findLength = find.length();
			try {
				boolean found = false;
				if (pos + findLength > document.getLength()) {
					pos = 0;
				}
				while (pos + findLength <= document.getLength()) {
					String match = document.getText(pos, findLength).toLowerCase();
					if (match.equals(find)) {
						found = true;
						break;
					}
					pos++;
				}
				if (found) {
					Rectangle viewRect = textArea.modelToView(pos);
					textArea.scrollRectToVisible(viewRect);
					textArea.setCaretPosition(pos + findLength);
					textArea.moveCaretPosition(pos);
					pos += findLength;
				}

			} catch (Exception exp) {
				logger.log(Level.ERROR, exp);
			}

		}
	});
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:58,代码来源:SourceViewerWindow.java


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