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


Java RTextScrollPane.setVerticalScrollBarPolicy方法代码示例

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


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

示例1: CustomCodeSyntaxPane

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

示例2: runButtonActionPerformed

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void runButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runButtonActionPerformed
    ensureOutputShown();
    final RubyConsole con = new RubyConsole();
    con.setMargin(new Insets(8, 8, 8, 8));
    RTextScrollPane pane = new RTextScrollPane();
    pane.setBorder(BorderFactory.createEmptyBorder());
    pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    pane.setViewportView(con);
    addDirectoryTree(con.getRuntime(), Amber.getWorkspace().getRootDirectory());
    closeableTabbedPane.add(pane, "Run");
    closeableTabbedPane.setSelectedComponent(pane);

    new Thread() {
        @Override
        public void run() {
            con.eval(editor.getText());
            con.getRuntime().getOutputStream().println("\n\nExited.");
            con.setEditable(false);
        }
    }.start();
}
 
开发者ID:IvyBits,项目名称:Amber-IDE,代码行数:23,代码来源:ScriptEditorPanel.java

示例3: irbButtonActionPerformed

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void irbButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_irbButtonActionPerformed
    ensureOutputShown();
    final RubyConsole con = new RubyConsole();
    con.setMargin(new Insets(8, 8, 8, 8));
    RTextScrollPane pane = new RTextScrollPane();
    pane.setBorder(BorderFactory.createEmptyBorder());
    pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    pane.setViewportView(con);
    addDirectoryTree(con.getRuntime(), Amber.getWorkspace().getRootDirectory());
    closeableTabbedPane.add(pane, "IRB");
    closeableTabbedPane.setSelectedComponent(pane);

    con.getRuntime().getOutputStream().println("Welcome to the IRB Console\n\n");
    new Thread() {
        @Override
        public void run() {
            con.eval("require 'irb'; require 'irb/completion'; IRB.start");
        }
    }.start();
}
 
开发者ID:IvyBits,项目名称:Amber-IDE,代码行数:22,代码来源:ScriptEditorPanel.java

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

示例5: ResultViewer

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public ResultViewer() {
    super(new BorderLayout());

    textArea = new RSyntaxTextArea(25, 70);
    textArea.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

    // Hide the default scroll bar
    scrollPane = new RTextScrollPane(textArea, false);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    // Set up custom line numbers
    gutter = scrollPane.getGutter();

    // Use a custom scroll bar
    scrollBar = new JScrollBar(JScrollBar.VERTICAL);

    // Hex table
    table = new JTable();
    table.setModel(tableModel = new HexTableModel());
    table.setDefaultRenderer(Object.class, new HexTableRenderer());

    add(scrollBar, BorderLayout.EAST);
    add(scrollPane, BorderLayout.CENTER);
    add(table, BorderLayout.SOUTH);

    // Attach reprint listeners
    addListeners();

    update(null, null, null);
}
 
开发者ID:LogicAndTrick,项目名称:kaitai_struct_ide,代码行数:31,代码来源:ResultViewer.java

示例6: Content

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public Content(){
	super(new BorderLayout());
	UIUtils.setMargin(this, new Insets(1,2,0,2));
	UIUtils.setUndecorated(this, true);
	editor = new Editor();
	theme.apply(editor);
	editorScroll = new RTextScrollPane(editor);
	editorScroll.getGutter().setBookmarkIcon(Icon.icon("bookmark"));
	editorScroll.getGutter().setBookmarkingEnabled(true);
	editorScroll.setVerticalScrollBarPolicy(RTextScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	UIUtils.setDrawBorder(editorScroll, false);
	studioPanel = new StudioPanel();
       // CardLayout
       card = new JPanel(new CardLayout());
       card.add(editorScroll, "Editor");
       card.add(studioPanel, "Studio");
       
       JPanel north = new JPanel(new VerticalFlowLayout());
       replacePanel = new ReplacePanel();
       north.add(replacePanel);
	add(north, BorderLayout.NORTH);
       add(card, BorderLayout.CENTER);
       
       JPanel vert = new JPanel(new VerticalFlowLayout());
       assetPanel = new AssetPanel();
       consolePanel = new ConsolePanel();
       assetPanel.setVisible(false);
       widgetPanel = new WidgetPanel();
       widgetPanel.setVisible(false);
       
       vert.add(widgetPanel);
       vert.add(assetPanel);
       vert.add(consolePanel);
       add(vert, BorderLayout.SOUTH);
       setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1, Style.border));
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:37,代码来源:Content.java

示例7: ScriptPageContent

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
/**
 * Script page content.
 * 
 * @param script
 *            script
 * @param language
 *            script language
 */
public ScriptPageContent(String script, Language language) {
	setLayout(new BorderLayout());

	textArea = new RSyntaxTextArea(20, 60);
	textArea.setTabSize(4);
	textArea.setSyntaxEditingStyle(language.getContentType());
	textArea.setCodeFoldingEnabled(true);
	textArea.setAntiAliasingEnabled(true);
	RTextScrollPane scrollPane = new RTextScrollPane(textArea);
	scrollPane.setFoldIndicatorEnabled(true);

	textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
	textArea.setText(script);
	textArea.setVisible(true);
	textArea.addKeyListener(new KeyAdapter() {
		@Override
		public void keyPressed(KeyEvent e) {
			if (e.isControlDown() && e.getKeyCode() == KeyEvent.VK_F) {
				searchField.requestFocus();
			}
			super.keyPressed(e);
		}
	});

	scrollPane.setBorder(BorderFactory.createEmptyBorder());
	scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	add(scrollPane, BorderLayout.CENTER);
	add(createToolBar(), BorderLayout.SOUTH);
}
 
开发者ID:naver,项目名称:ngrinder-recorder,代码行数:39,代码来源:ScriptPageContent.java

示例8: OwnSyntaxPane

import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public OwnSyntaxPane() {

		panel = new JPanel(new FlowLayout());
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		textArea = new RSyntaxTextArea() {
			private static final long serialVersionUID = 7431070002967577129L;

			@Override
			public void undoLastAction() {
				CurrentDiagram.getInstance().getDiagramHandler().getController().undo();
			}

			@Override
			public void redoLastAction() {
				CurrentDiagram.getInstance().getDiagramHandler().getController().redo();
			}
		};

		// Setup highlighting
		createHightLightMap();
		AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
		atmf.putMapping(OwnTokenMaker.ID, OwnTokenMaker.class.getName());
		textArea.setSyntaxEditingStyle(OwnTokenMaker.ID);

		textArea.getSyntaxScheme().getStyle(TokenTypes.RESERVED_WORD).foreground = Converter.convert(ColorOwn.SYNTAX_HIGHLIGHTING);

		// Setup autocompletion
		createAutocompletionCompletionProvider();
		AutoCompletion ac = new AutoCompletion(provider);
		// ac.setShowDescWindow(true);
		ac.install(textArea);

		JLabel propertyLabel = new JLabel(" Properties");
		propertyLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
		propertyLabel.setFont(DerivedConfig.getPanelHeaderFont());
		panel.add(propertyLabel);

		textArea.setAntiAliasingEnabled(true);
		textArea.setFont(DerivedConfig.getPanelContentFont());
		scrollPane = new RTextScrollPane(textArea, false);
		scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
		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,代码行数:48,代码来源:OwnSyntaxPane.java


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