當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。