本文整理汇总了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
}
示例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();
}
示例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();
}
示例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);
}
示例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
}