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


Java RTextScrollPane.setHorizontalScrollBarPolicy方法代码示例

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


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

示例5: 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.setHorizontalScrollBarPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。