本文整理匯總了Java中org.fife.ui.rtextarea.RTextScrollPane類的典型用法代碼示例。如果您正苦於以下問題:Java RTextScrollPane類的具體用法?Java RTextScrollPane怎麽用?Java RTextScrollPane使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RTextScrollPane類屬於org.fife.ui.rtextarea包,在下文中一共展示了RTextScrollPane類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: SourceCodeEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
/**
*
* @param frame
* @param name
*/
public SourceCodeEditor(MainFrame frame, String name) {
super(frame);
this.fileName = name;
setName(name);
setLayout(new BorderLayout());
textarea = new TextEditorPane();
textarea.setCodeFoldingEnabled(true);
textarea.setAnimateBracketMatching(true);
textarea.setAutoIndentEnabled(true);
textarea.setBracketMatchingEnabled(true);
textarea.setAntiAliasingEnabled(true);
textarea.getDocument().addDocumentListener(this);
RTextScrollPane scrollpane = new RTextScrollPane(textarea);
scrollpane.setFoldIndicatorEnabled(true);
add(scrollpane);
}
示例2: setupLayout
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
private void setupLayout()
{
setLayout(new MigLayout("wrap 3", "[][][fill,grow]"));
setBorder(AppletGuiUtils.DEFAULT_BORDER);
add(nameLabel);
add(name, "span 2, grow");
add(descriptionLabel, "aligny top");
add(description, "span 2, grow");
add(moveToLive, "span 3");
add(moveToLiveArrival, "skip, span 3");
add(moveToLiveAccept, "skip, span 3");
add(proceedNext, "span 3");
add(proceedExplanation, "skip, span3, gap i*2.3");
add(scriptLabel, "span 3");
add(script, "span 3, grow");
RTextScrollPane scroll = new RTextScrollPane(script);
add(scroll, "span 3, grow");
add(statusbar, "span 3, grow");
}
示例3: createClientEditorsSection
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
protected JComponent createClientEditorsSection()
{
freemarker = createHtmlHighlightingPane();
jquery = new JShuffleBox<NameValue>();
onloadJs = createJavascriptHighlightingPane();
onsubmitJs = createJavascriptHighlightingPane();
JTabbedPane clientEditors = new JTabbedPane();
addCodeTab(clientEditors, "tab.template", new RTextScrollPane(freemarker)); //$NON-NLS-1$
addCodeTab(clientEditors, "tab.onload", new RTextScrollPane(onloadJs)); //$NON-NLS-1$
addCodeTab(clientEditors, "tab.onsubmit", new RTextScrollPane(onsubmitJs)); //$NON-NLS-1$
clientEditors.addTab(getString("tab.libraries"), jquery); //$NON-NLS-1$
clientEditors.setPreferredSize(new Dimension(clientEditors.getWidth(), CODE_HEIGHT));
return clientEditors;
}
示例4: createAdvanced
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
private JPanel createAdvanced()
{
JLabel titleLabel = new JLabel(CurrentLocale.get("com.dytech.edge.admin.script.scriptpanel.javascript")); //$NON-NLS-1$
advanced = new EquellaSyntaxTextArea(CODE_HEIGHT_LINES, CODE_WIDTH_COLUMNS);
advanced.addCaretListener(this);
advanced.addFocusListener(this);
RTextScrollPane advancedScroll = new RTextScrollPane(advanced);
final int height = titleLabel.getPreferredSize().height;
final int[] rows = {height, TableLayout.FILL};
final int[] cols = {TableLayout.FILL};
JPanel all = new JPanel(new TableLayout(rows, cols, 5, 5));
all.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
all.add(titleLabel, new Rectangle(0, 0, 1, 1));
all.add(advancedScroll, new Rectangle(0, 1, 1, 1));
return all;
}
示例5: addOrSwitchToTab
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
private void addOrSwitchToTab(final OpenFile open) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
final String title = open.name;
RTextScrollPane rTextScrollPane = open.scrollPane;
if (house.indexOfTab(title) < 0) {
house.addTab(title, rTextScrollPane);
house.setSelectedIndex(house.indexOfTab(title));
int index = house.indexOfTab(title);
Tab ct = new Tab(title);
ct.getButton().addMouseListener(new CloseTab(title));
house.setTabComponentAt(index, ct);
} else {
house.setSelectedIndex(house.indexOfTab(title));
}
open.onAddedToScreen();
} catch (Exception e) {
Luyten.showExceptionDialog("Exception!", e);
}
}
});
}
示例6: testApply
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
@Test
public void testApply() {
RSyntaxTextArea textArea1 = new RSyntaxTextArea(
SyntaxConstants.SYNTAX_STYLE_PHP);
RTextScrollPane sp1 = new RTextScrollPane(textArea1);
Gutter gutter1 = sp1.getGutter();
initWithOddProperties(textArea1, gutter1);
RSyntaxTextArea textArea2 = new RSyntaxTextArea(
SyntaxConstants.SYNTAX_STYLE_PHP);
RTextScrollPane sp2 = new RTextScrollPane(textArea2);
Gutter gutter2 = sp2.getGutter();
assertAllThemePropertiesDifferent(textArea1, gutter1, textArea2, gutter2);
Theme theme = new Theme(textArea1);
theme.apply(textArea2);
assertEqualThemeProperties(textArea1, gutter1, textArea2, gutter2);
}
示例7: testLoad_FromStream_NoDefaultFont
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
@Test
public void testLoad_FromStream_NoDefaultFont() throws Exception {
InputStream in = getClass().getResourceAsStream("ThemeTest_theme1.xml");
Theme theme = Theme.load(in);
in.close();
RSyntaxTextArea textArea1 = new RSyntaxTextArea(
SyntaxConstants.SYNTAX_STYLE_PHP);
RTextScrollPane sp1 = new RTextScrollPane(textArea1);
Gutter gutter1 = sp1.getGutter();
initWithOddProperties(textArea1, gutter1);
theme.apply(textArea1);
assertColorsMatchTheme1(textArea1, gutter1);
}
示例8: createTextComponentImpl
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
@Override
protected RSyntaxTextArea createTextComponentImpl() {
RSyntaxTextArea impl = new RSyntaxTextArea();
int height = (int) impl.getPreferredSize().getHeight();
impl.setMinimumSize(new Dimension(0, height));
RTextScrollPane scrollPane = new RTextScrollPane(impl);
scrollPane.setLineNumbersEnabled(showGutter);
composition = scrollPane;
composition.setPreferredSize(new Dimension(150, height));
composition.setMinimumSize(new Dimension(0, height));
doc.putProperty("filterNewlines", false);
return impl;
}
示例9: createBottomPanel
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
/**
* @param debuggerActions
* @param loadChooser
* @return
*/
static Component createBottomPanel(final AgentDebuggerFrame frame) {
JPanel panel = new JPanel(new BorderLayout());
RSyntaxTextArea loggerTA = new RSyntaxTextArea();
frame.setLoggerTA(loggerTA);
loggerTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
loggerTA.setHyperlinksEnabled(false);
loggerTA.setEditable(false);
loggerTA.setHighlightCurrentLine(false);
JPopupMenu popupMenu = new JPopupMenu();
popupMenu.add(frame.getDebuggerActions().getSaveLogAction());
popupMenu.add(frame.getDebuggerActions().getClearLogOutputAction());
loggerTA.setPopupMenu(popupMenu);
RTextScrollPane sp = new RTextScrollPane(loggerTA);
sp.setIconRowHeaderEnabled(false);
sp.getGutter().setBookmarkingEnabled(false);
panel.add(sp, BorderLayout.CENTER);
DebuggerAppender.addTextArea(loggerTA);
return panel;
}
示例10: StepDialog
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
public StepDialog(AgentDebuggerFrame f, String text, String type) {
super(f, true);
this.f = f;
setLayout(new BorderLayout());
ta = new RSyntaxTextArea();
ta.setSyntaxEditingStyle(type);
ta.setHyperlinksEnabled(false);
ta.setText(text);
ta.setCaretPosition(0);
RTextScrollPane sp = new RTextScrollPane(ta);
sp.setIconRowHeaderEnabled(true);
add(BorderLayout.CENTER, sp);
add(createButtonPanel(), BorderLayout.SOUTH);
setSize(new Dimension(800, 600));
setBounds(new Rectangle(getSize()));
setPreferredSize(getSize());
WindowUtil.centerOnParent(this);
}
示例11: addComponenets
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
protected void addComponenets() {
this.codingArea = new RSyntaxTextArea(18, 60);
codingArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PYTHON);
codingArea.setCodeFoldingEnabled(true);
codingArea.setText(standardScript());
bodyPanel.setLayout(new BorderLayout());
JPanel northPanel = addToNorth();
if (northPanel != null) {
bodyPanel.add(northPanel, BorderLayout.NORTH);
}
bodyPanel.add(new RTextScrollPane(codingArea), BorderLayout.CENTER);
// insert footer button
okButton = new JButton("OK");
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
returnedValue = RETURNED_VALUES.SUCCESS;
CodeDialog.this.dispose();
}
});
addFooterButton(okButton, true);
}
示例12: createSnippetPanel
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
/**
* Create the panel with the snippet.
*/
private JComponent createSnippetPanel() {
updateAutocompletion();
m_snippetTextArea = new JSnippetTextArea(m_snippet);
// reset style which causes a recreation of the folds
// this code is also executed in "onOpen" but that is not called for the template viewer tab
m_snippetTextArea.setSyntaxEditingStyle(
SyntaxConstants.SYNTAX_STYLE_NONE);
m_snippetTextArea.setSyntaxEditingStyle(
SyntaxConstants.SYNTAX_STYLE_JAVA);
// collapse all folds
int foldCount = m_snippetTextArea.getFoldManager().getFoldCount();
for (int i = 0; i < foldCount; i++) {
Fold fold = m_snippetTextArea.getFoldManager().getFold(i);
fold.setCollapsed(true);
}
JScrollPane snippetScroller = new RTextScrollPane(m_snippetTextArea);
JPanel snippet = new JPanel(new BorderLayout());
snippet.add(snippetScroller, BorderLayout.CENTER);
ErrorStrip es = new ErrorStrip(m_snippetTextArea);
snippet.add(es, BorderLayout.LINE_END);
return snippet;
}
示例13: createRTextScrollPane
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
public static RTextScrollPane createRTextScrollPane(RTextArea textArea){
Constructor[] ctors = RTextScrollPane.class.getConstructors();
Constructor ctor = null;
for(Constructor tmpCtor : ctors){
Class[] paramClasses = tmpCtor.getParameterTypes();
if(paramClasses != null && paramClasses.length == 1 && paramClasses[0].isAssignableFrom(RTextArea.class)){
ctor = tmpCtor;
break;
}
}
try {
return (RTextScrollPane) ctor.newInstance(textArea);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
SoapUI.logError(e);
return null;
}
}
示例14: CodeEditor
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
/**
* Creates the code editor.
*/
public CodeEditor() {
super();
scrollPane = new RTextScrollPane(this);
scrollPane.setIconRowHeaderEnabled(true);
setRows(20);
setColumns(80);
setMarginLinePosition(80);
setAntiAliasingEnabled(true);
//setMarkOccurrences(true);
setLineWrap(true);
setColors();
completeProvider = new MIPSCompletionProvider();
complete = new AutoCompletion(completeProvider);
complete.setShowDescWindow(true);
complete.setAutoCompleteSingleChoices(false);
complete.install(this);
}
示例15: createRTextScrollPane
import org.fife.ui.rtextarea.RTextScrollPane; //導入依賴的package包/類
public static RTextScrollPane createRTextScrollPane(RTextArea textArea) {
Constructor[] ctors = RTextScrollPane.class.getConstructors();
Constructor ctor = null;
for (Constructor tmpCtor : ctors) {
Class[] paramClasses = tmpCtor.getParameterTypes();
if (paramClasses != null && paramClasses.length == 1 && paramClasses[0].isAssignableFrom(RTextArea.class)) {
ctor = tmpCtor;
break;
}
}
try {
return (RTextScrollPane) ctor.newInstance(textArea);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
LOGGER.error(e);
return null;
}
}