本文整理匯總了Java中org.fife.ui.rtextarea.RTextScrollPane.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java RTextScrollPane.setBorder方法的具體用法?Java RTextScrollPane.setBorder怎麽用?Java RTextScrollPane.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rtextarea.RTextScrollPane
的用法示例。
在下文中一共展示了RTextScrollPane.setBorder方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
示例2: 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();
}
示例3: XMLEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public XMLEditor(MainFrame mainFrame) {
super(new BorderLayout());
this.mainFrame = mainFrame;
// create text area
this.editor = new RSyntaxTextArea(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_XML));
this.editor.setAnimateBracketMatching(true);
this.editor.setAutoIndentEnabled(true);
this.editor.setSelectionColor(Colors.TEXT_HIGHLIGHT_BACKGROUND);
this.editor.setBorder(null);
JToolBar toolBar = new ExtendedJToolBar();
toolBar.setBorder(null);
toolBar.add(new ResourceAction(true, "xml_editor.apply_changes") {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
try {
validateProcess();
} catch (IOException | XMLException e1) {
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.processeditor.XMLEditor.failed_to_parse_process");
}
}
});
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER));
add(toolBar, BorderLayout.NORTH);
RTextScrollPane rTextScrollPane = new RTextScrollPane(editor);
rTextScrollPane.setBorder(null);
add(rTextScrollPane, BorderLayout.CENTER);
}
示例4: addNewTab
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
/**
* Adds a tab labeled "*" to the TabbedPane. Also, adds a SparqlTextArea to
the tab, and modifies the text-area's pop-up menu to show a "Rename Tab"
option and removes the code-folding option.
*/
private void addNewTab() {
SparqlTextArea textEditor = new SparqlTextArea();
RTextScrollPane sp = new RTextScrollPane( textEditor );
sp.setFoldIndicatorEnabled( false );
this.addTab( "*", sp );
this.setToolTipTextAt( this.getTabCount() - 1, "Add New Tab" );
//If nothing is set to the text editor, when it is opened in V-CAMP/SEMOSS,
//it may not respond to programmatic assignment, and the tool may hang:
//textEditor.setText( "" );
//Add an item to the context-popup menu that allows one to rename the current tab:
JPopupMenu popup = textEditor.getPopupMenu();
popup.add( renamer );
//Place a black 1px border around the top component in TabbedQueries:
sp.setBorder( BorderFactory.createMatteBorder( 0, 1, 1, 1, Color.BLACK ) );
// Fix to make sure that bracket match highlighting follows component resize
// (really small windows can make it ugly)
textEditor.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized( ComponentEvent e ) {
int caratPosistion = ( (SparqlTextArea) e.getSource() ).getCaretPosition();
( (SparqlTextArea) e.getSource() ).setCaretPosition( 0 );
( (SparqlTextArea) e.getSource() ).setCaretPosition( caratPosistion );
}
} );
}
示例5: addTextArea
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
private void addTextArea() {
textArea = new RSyntaxTextArea();
textArea.setHighlightCurrentLine(true);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);
scrollBar = new RTextScrollPane(textArea);
scrollBar.setBorder(null);
scrollBar.setLineNumbersEnabled(true);
scrollBar.setViewportView(textArea);
this.getContentPane().add(scrollBar);
}
示例6: XMLEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public XMLEditor(MainFrame mainFrame) {
super(new BorderLayout());
this.mainFrame = mainFrame;
// create text area
this.editor = new RSyntaxTextArea(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_XML));
this.editor.setAnimateBracketMatching(true);
this.editor.setAutoIndentEnabled(true);
this.editor.setSelectionColor(Colors.TEXT_HIGHLIGHT_BACKGROUND);
this.editor.setBorder(null);
JToolBar toolBar = new ExtendedJToolBar();
toolBar.setBorder(null);
toolBar.add(new ResourceAction(true, "xml_editor.apply_changes") {
private static final long serialVersionUID = 1L;
@Override
public void loggedActionPerformed(ActionEvent e) {
try {
validateProcess();
} catch (IOException | XMLException e1) {
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.processeditor.XMLEditor.failed_to_parse_process");
}
}
});
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER));
add(toolBar, BorderLayout.NORTH);
RTextScrollPane rTextScrollPane = new RTextScrollPane(editor);
rTextScrollPane.setBorder(null);
add(rTextScrollPane, BorderLayout.CENTER);
}
示例7: SqlEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public SqlEditor() {
setBorder(null);
setLayout(new BorderLayout(0, 0));
SCToolBar toolBar = new SCToolBar();
toolBar.add("sql:Run", AwesomeIconConstants.FA_PLAY, "Run SQL");
toolBar.addSeparator();
toolBar.add("sql:Open", AwesomeIconConstants.FA_FOLDER_OPEN_O, "Open...");
toolBar.add("sql:Save", AwesomeIconConstants.FA_SAVE, "Save...");
toolBar.addSeparator();
toolBar.add("sql:ShowSqlHistory", AwesomeIconConstants.FA_HISTORY, "Show SQL History...");
toolBar.add("sql:PreviousSql", AwesomeIconConstants.FA_ARROW_CIRCLE_LEFT,
"Restore Previous SQL From History");
toolBar.add("sql:NextSql", AwesomeIconConstants.FA_ARROW_CIRCLE_RIGHT,
"Restore Next SQL From History");
add(toolBar, BorderLayout.NORTH);
textArea = new RSyntaxTextArea();
// textArea.setWrapStyleWord(true);
// textArea.setLineWrap(true);
textArea.setTabSize(4);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
// textArea.setCodeFoldingEnabled(true);
RTextScrollPane scrollPane = new RTextScrollPane(textArea);
scrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0,
UIConstants.getDefaultBorderColor()));
add(scrollPane, BorderLayout.CENTER);
}
示例8: getComponent
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
@Override
public Component getComponent(GraphDocument document) {
if(settingsPanel == null) {
settingsPanel = new JPanel(new GridBagLayout());
final GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
gbc.weighty = 0.0;
printOnlyChangedBox = new JCheckBox("Print only changed values");
printOnlyChangedBox.setSelected(printOnlyChanged);
settingsPanel.add(printOnlyChangedBox, gbc);
++gbc.gridy;
gbc.fill = GridBagConstraints.BOTH;
gbc.weighty = 1.0;
includesArea = new RSyntaxTextArea();
includesArea.setText(includes.stream().collect(Collectors.joining("\n")));
final RTextScrollPane includesScroller = new RTextScrollPane(includesArea);
includesScroller.setBorder(BorderFactory.createTitledBorder("Includes"));
settingsPanel.add(includesScroller, gbc);
++gbc.gridy;
excludesArea = new RSyntaxTextArea();
excludesArea.setText(excludes.stream().collect(Collectors.joining("\n")));
final RTextScrollPane excludesScroller = new RTextScrollPane(excludesArea);
excludesScroller.setBorder(BorderFactory.createTitledBorder("Excludes"));
settingsPanel.add(excludesScroller, gbc);
}
return settingsPanel;
}
示例9: 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);
}
示例10: MacroEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public MacroEditor() {
setLayout(new BorderLayout(0, 0));
SCToolBar toolBar = new SCToolBar();
toolBar.setFocusable(false);
toolBar.setFloatable(false);
add(toolBar, BorderLayout.NORTH);
toolBar.add("macro:Open", AwesomeIconConstants.FA_FOLDER_OPEN_O,
CoreBundle.get("key.open") + "...");
toolBar.add("macro:Save", AwesomeIconConstants.FA_SAVE, CoreBundle.get("key.save") + "...");
toolBar.addSeparator();
JButton startRecordButton = toolBar.add("macro:ToggleRecordingMacro",
AwesomeIconConstants.FA_CIRCLE, CoreBundle.get("key.startRecordMacro"));
JButton stopRecordButton = toolBar.add("macro:ToggleRecordingMacro",
AwesomeIconConstants.FA_STOP, CoreBundle.get("key.stopRecordMacro"));
stopRecordButton.setVisible(false);
toolBar.addSeparator();
toolBar.add("macro:Run", AwesomeIconConstants.FA_PLAY, CoreBundle.get("key.run"));
MacroRecorder.RECORDING
.addValueChangedListener(new Consumer<Condition.ConditionValueChangeEvent>() {
@Override
public void accept(ConditionValueChangeEvent t) {
startRecordButton.setVisible(!t.newValue);
stopRecordButton.setVisible(t.newValue);
}
});
textArea = new RSyntaxTextArea();
// textArea.setWrapStyleWord(true);
// textArea.setLineWrap(true);
textArea.setTabSize(2);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
textArea.setCodeFoldingEnabled(true);
textArea.setMarkOccurrences(true);
textArea.setTabsEmulated(true);
installAutoComplete(textArea);
RTextScrollPane scrollPane = new RTextScrollPane(textArea);
scrollPane.setBorder(
BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.getDefaultBorderColor()));
add(scrollPane, BorderLayout.CENTER);
MacroRecorder.setMacroAppendListener(lines -> {
textArea.setText(String.join("\n", lines));
});
}
示例11: addTextArea
import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
private void addTextArea() {
jtfFilter = new JTextField();
findButton = new JButton("Next word");
textArea = new RSyntaxTextArea();
textArea.setHighlightCurrentLine(true);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setEditable(false);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
scrollBar = new RTextScrollPane(textArea);
scrollBar.setBorder(null);
scrollBar.setLineNumbersEnabled(true);
scrollBar.setViewportView(textArea);
this.getContentPane().add(scrollBar);
JPanel panel = new JPanel(new BorderLayout());
panel.add(new JLabel("Specify a word to match:"), BorderLayout.WEST);
panel.add(jtfFilter, BorderLayout.CENTER);
panel.add(findButton, BorderLayout.EAST);
add(panel, BorderLayout.SOUTH);
findButton.addActionListener(e -> {
String find = jtfFilter.getText().toLowerCase();
textArea.requestFocusInWindow();
if (!Strings.isBlank(find)) {
Document document = textArea.getDocument();
int findLength = find.length();
try {
boolean found = false;
if (pos + findLength > document.getLength()) {
pos = 0;
}
while (pos + findLength <= document.getLength()) {
String match = document.getText(pos, findLength).toLowerCase();
if (match.equals(find)) {
found = true;
break;
}
pos++;
}
if (found) {
Rectangle viewRect = textArea.modelToView(pos);
textArea.scrollRectToVisible(viewRect);
textArea.setCaretPosition(pos + findLength);
textArea.moveCaretPosition(pos);
pos += findLength;
}
} catch (Exception exp) {
logger.log(Level.ERROR, exp);
}
}
});
}