本文整理匯總了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
}