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


Java RTextScrollPane类代码示例

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


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

示例1: SourceCodeEditor

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
/**
 *
 * @param frame
 * @param name
 */
public SourceCodeEditor(MainFrame frame, String name) {
	super(frame);
	this.fileName = name;
	setName(name);
	setLayout(new BorderLayout());
	textarea = new TextEditorPane();
	textarea.setCodeFoldingEnabled(true);
	textarea.setAnimateBracketMatching(true);
	textarea.setAutoIndentEnabled(true);
	textarea.setBracketMatchingEnabled(true);
	textarea.setAntiAliasingEnabled(true);
	textarea.getDocument().addDocumentListener(this);

	RTextScrollPane scrollpane = new RTextScrollPane(textarea);
	scrollpane.setFoldIndicatorEnabled(true);
	add(scrollpane);
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:23,代码来源:SourceCodeEditor.java

示例2: setupLayout

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
private void setupLayout()
{
	setLayout(new MigLayout("wrap 3", "[][][fill,grow]"));
	setBorder(AppletGuiUtils.DEFAULT_BORDER);

	add(nameLabel);
	add(name, "span 2, grow");

	add(descriptionLabel, "aligny top");
	add(description, "span 2, grow");

	add(moveToLive, "span 3");
	add(moveToLiveArrival, "skip, span 3");
	add(moveToLiveAccept, "skip, span 3");

	add(proceedNext, "span 3");
	add(proceedExplanation, "skip, span3, gap i*2.3");

	add(scriptLabel, "span 3");
	add(script, "span 3, grow");

	RTextScrollPane scroll = new RTextScrollPane(script);
	add(scroll, "span 3, grow");
	
	add(statusbar, "span 3, grow");
}
 
开发者ID:equella,项目名称:Equella,代码行数:27,代码来源:ScriptTab.java

示例3: createClientEditorsSection

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
protected JComponent createClientEditorsSection()
{
	freemarker = createHtmlHighlightingPane();
	jquery = new JShuffleBox<NameValue>();
	onloadJs = createJavascriptHighlightingPane();
	onsubmitJs = createJavascriptHighlightingPane();

	JTabbedPane clientEditors = new JTabbedPane();
	addCodeTab(clientEditors, "tab.template", new RTextScrollPane(freemarker)); //$NON-NLS-1$
	addCodeTab(clientEditors, "tab.onload", new RTextScrollPane(onloadJs)); //$NON-NLS-1$
	addCodeTab(clientEditors, "tab.onsubmit", new RTextScrollPane(onsubmitJs)); //$NON-NLS-1$
	clientEditors.addTab(getString("tab.libraries"), jquery); //$NON-NLS-1$
	clientEditors.setPreferredSize(new Dimension(clientEditors.getWidth(), CODE_HEIGHT));

	return clientEditors;
}
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:AdvancedScriptControlEditor.java

示例4: createAdvanced

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
private JPanel createAdvanced()
{
	JLabel titleLabel = new JLabel(CurrentLocale.get("com.dytech.edge.admin.script.scriptpanel.javascript")); //$NON-NLS-1$

	advanced = new EquellaSyntaxTextArea(CODE_HEIGHT_LINES, CODE_WIDTH_COLUMNS);
	advanced.addCaretListener(this);
	advanced.addFocusListener(this);
	RTextScrollPane advancedScroll = new RTextScrollPane(advanced);

	final int height = titleLabel.getPreferredSize().height;
	final int[] rows = {height, TableLayout.FILL};
	final int[] cols = {TableLayout.FILL};

	JPanel all = new JPanel(new TableLayout(rows, cols, 5, 5));
	all.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

	all.add(titleLabel, new Rectangle(0, 0, 1, 1));
	all.add(advancedScroll, new Rectangle(0, 1, 1, 1));

	return all;
}
 
开发者ID:equella,项目名称:Equella,代码行数:22,代码来源:ScriptPanel.java

示例5: addOrSwitchToTab

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
private void addOrSwitchToTab(final OpenFile open) {
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			try {
				final String title = open.name;
				RTextScrollPane rTextScrollPane = open.scrollPane;
				if (house.indexOfTab(title) < 0) {
					house.addTab(title, rTextScrollPane);
					house.setSelectedIndex(house.indexOfTab(title));
					int index = house.indexOfTab(title);
					Tab ct = new Tab(title);
					ct.getButton().addMouseListener(new CloseTab(title));
					house.setTabComponentAt(index, ct);
				} else {
					house.setSelectedIndex(house.indexOfTab(title));
				}
				open.onAddedToScreen();
			} catch (Exception e) {
				Luyten.showExceptionDialog("Exception!", e);
			}
		}
	});
}
 
开发者ID:KevinPriv,项目名称:Luyten4Forge,代码行数:25,代码来源:Model.java

示例6: testApply

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
@Test
public void testApply() {

	RSyntaxTextArea textArea1 = new RSyntaxTextArea(
			SyntaxConstants.SYNTAX_STYLE_PHP);
	RTextScrollPane sp1 = new RTextScrollPane(textArea1);
	Gutter gutter1 = sp1.getGutter();
	initWithOddProperties(textArea1, gutter1);
	
	RSyntaxTextArea textArea2 = new RSyntaxTextArea(
			SyntaxConstants.SYNTAX_STYLE_PHP);
	RTextScrollPane sp2 = new RTextScrollPane(textArea2);
	Gutter gutter2 = sp2.getGutter();

	assertAllThemePropertiesDifferent(textArea1, gutter1, textArea2, gutter2);

	Theme theme = new Theme(textArea1);
	theme.apply(textArea2);
	assertEqualThemeProperties(textArea1, gutter1, textArea2, gutter2);

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:22,代码来源:ThemeTest.java

示例7: testLoad_FromStream_NoDefaultFont

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
@Test
public void testLoad_FromStream_NoDefaultFont() throws Exception {

	InputStream in = getClass().getResourceAsStream("ThemeTest_theme1.xml");
	Theme theme = Theme.load(in);
	in.close();

	RSyntaxTextArea textArea1 = new RSyntaxTextArea(
			SyntaxConstants.SYNTAX_STYLE_PHP);
	RTextScrollPane sp1 = new RTextScrollPane(textArea1);
	Gutter gutter1 = sp1.getGutter();
	initWithOddProperties(textArea1, gutter1);

	theme.apply(textArea1);
	assertColorsMatchTheme1(textArea1, gutter1);

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:18,代码来源:ThemeTest.java

示例8: 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

示例9: createBottomPanel

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

示例10: StepDialog

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

示例11: addComponenets

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
protected void addComponenets() {
	this.codingArea = new RSyntaxTextArea(18, 60);
	codingArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PYTHON);
	codingArea.setCodeFoldingEnabled(true);
	codingArea.setText(standardScript());
	
	bodyPanel.setLayout(new BorderLayout());
	
	JPanel northPanel = addToNorth();
	if (northPanel != null) {
		bodyPanel.add(northPanel, BorderLayout.NORTH);
	}
	bodyPanel.add(new RTextScrollPane(codingArea), BorderLayout.CENTER);
	
	// insert footer button
	okButton = new JButton("OK");
	okButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			returnedValue = RETURNED_VALUES.SUCCESS;
			CodeDialog.this.dispose();
		}
	});
	addFooterButton(okButton, true);
}
 
开发者ID:delas,项目名称:plg,代码行数:26,代码来源:CodeDialog.java

示例12: createSnippetPanel

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
/**
 * Create the panel with the snippet.
 */
private JComponent createSnippetPanel() {
    updateAutocompletion();

    m_snippetTextArea = new JSnippetTextArea(m_snippet);

    // reset style which causes a recreation of the folds
    // this code is also executed in "onOpen" but that is not called for the template viewer tab
    m_snippetTextArea.setSyntaxEditingStyle(
            SyntaxConstants.SYNTAX_STYLE_NONE);
    m_snippetTextArea.setSyntaxEditingStyle(
            SyntaxConstants.SYNTAX_STYLE_JAVA);
    // collapse all folds
    int foldCount = m_snippetTextArea.getFoldManager().getFoldCount();
    for (int i = 0; i < foldCount; i++) {
        Fold fold = m_snippetTextArea.getFoldManager().getFold(i);
        fold.setCollapsed(true);
    }
    JScrollPane snippetScroller = new RTextScrollPane(m_snippetTextArea);
    JPanel snippet = new JPanel(new BorderLayout());
    snippet.add(snippetScroller, BorderLayout.CENTER);
    ErrorStrip es = new ErrorStrip(m_snippetTextArea);
    snippet.add(es, BorderLayout.LINE_END);
    return snippet;
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:28,代码来源:JavaSnippetForRDDNodeDialog.java

示例13: createRTextScrollPane

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
public static RTextScrollPane createRTextScrollPane(RTextArea textArea){
    Constructor[] ctors = RTextScrollPane.class.getConstructors();
    Constructor ctor = null;
    for(Constructor tmpCtor : ctors){
        Class[] paramClasses = tmpCtor.getParameterTypes();
        if(paramClasses != null && paramClasses.length == 1 && paramClasses[0].isAssignableFrom(RTextArea.class)){
            ctor = tmpCtor;
            break;
        }
    }
    try {
        return (RTextScrollPane) ctor.newInstance(textArea);
    } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
        SoapUI.logError(e);
        return null;
    }
}
 
开发者ID:SmartBear,项目名称:ready-mqtt-plugin,代码行数:18,代码来源:Utils.java

示例14: CodeEditor

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
/**
 * Creates the code editor.
 */
public CodeEditor() {
	super();
	scrollPane = new RTextScrollPane(this);
	scrollPane.setIconRowHeaderEnabled(true);
	setRows(20);
	setColumns(80);
	setMarginLinePosition(80);
	setAntiAliasingEnabled(true);
	//setMarkOccurrences(true);
	setLineWrap(true);
	setColors();
	
	completeProvider = new MIPSCompletionProvider();
	complete = new AutoCompletion(completeProvider);
	complete.setShowDescWindow(true);
	complete.setAutoCompleteSingleChoices(false);
	complete.install(this);
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:22,代码来源:CodeEditor.java

示例15: createRTextScrollPane

import org.fife.ui.rtextarea.RTextScrollPane; //导入依赖的package包/类
public static RTextScrollPane createRTextScrollPane(RTextArea textArea) {
    Constructor[] ctors = RTextScrollPane.class.getConstructors();
    Constructor ctor = null;
    for (Constructor tmpCtor : ctors) {
        Class[] paramClasses = tmpCtor.getParameterTypes();
        if (paramClasses != null && paramClasses.length == 1 && paramClasses[0].isAssignableFrom(RTextArea.class)) {
            ctor = tmpCtor;
            break;
        }
    }
    try {
        return (RTextScrollPane) ctor.newInstance(textArea);
    } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
        LOGGER.error(e);
        return null;
    }
}
 
开发者ID:hschott,项目名称:ready-websocket-plugin,代码行数:18,代码来源:Utils.java


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