當前位置: 首頁>>代碼示例>>Java>>正文


Java RTextScrollPane.setVerticalScrollBarPolicy方法代碼示例

本文整理匯總了Java中org.fife.ui.rtextarea.RTextScrollPane.setVerticalScrollBarPolicy方法的典型用法代碼示例。如果您正苦於以下問題:Java RTextScrollPane.setVerticalScrollBarPolicy方法的具體用法?Java RTextScrollPane.setVerticalScrollBarPolicy怎麽用?Java RTextScrollPane.setVerticalScrollBarPolicy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.fife.ui.rtextarea.RTextScrollPane的用法示例。


在下文中一共展示了RTextScrollPane.setVerticalScrollBarPolicy方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: QueryEditor

import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public QueryEditor(SyntaxElementSource syntaxElementSource, CompletionsSource completionsSource,
		ClientSettings clientSettings) {
	Check.notNull(syntaxElementSource);

	this.syntaxElementSource = syntaxElementSource;
	this.completionsSource = completionsSource;
	this.clientSettings = clientSettings;

	queryText = createTextArea();
	queryText.addParser(new GftParser(syntaxElementSource, onStartParsing, onFinshParsing));
	queryText.setMarkOccurrences(false);
	queryText.setHighlightCurrentLine(clientSettings.highlightCurrentLine);

	queryText.setParserDelay(700);
	waitStateDisplay = new WaitStateDisplay(queryText);

	scrollPane = new RTextScrollPane(queryText, false);
	scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	Gutter gutter = scrollPane.getGutter();
	gutter.setBookmarkingEnabled(true);
	scrollPane.setIconRowHeaderEnabled(true);
	scrollPane.setLineNumbersEnabled(clientSettings.lineNumbersEnabled);

	setTheme(clientSettings.editorThemeXml);

	URL url = getClass().getResource(Const.resourcePath + "bookmark.png");

	gutter.setBookmarkIcon(new ImageIcon(url));

	getContentPane().add(scrollPane);
	ErrorStrip errorStrip = new ErrorStrip(queryText);

	getContentPane().add(errorStrip, BorderLayout.LINE_END);

	setCompletionProvider();
	setTokenMaker();
	queryText.setSyntaxEditingStyle(Const.languageId);

	registerForLongOperationEvent();
}
 
開發者ID:curiosag,項目名稱:ftc,代碼行數:41,代碼來源:QueryEditor.java

示例5: ResultViewer

import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public ResultViewer() {
    super(new BorderLayout());

    textArea = new RSyntaxTextArea(25, 70);
    textArea.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

    // Hide the default scroll bar
    scrollPane = new RTextScrollPane(textArea, false);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    // Set up custom line numbers
    gutter = scrollPane.getGutter();

    // Use a custom scroll bar
    scrollBar = new JScrollBar(JScrollBar.VERTICAL);

    // Hex table
    table = new JTable();
    table.setModel(tableModel = new HexTableModel());
    table.setDefaultRenderer(Object.class, new HexTableRenderer());

    add(scrollBar, BorderLayout.EAST);
    add(scrollPane, BorderLayout.CENTER);
    add(table, BorderLayout.SOUTH);

    // Attach reprint listeners
    addListeners();

    update(null, null, null);
}
 
開發者ID:LogicAndTrick,項目名稱:kaitai_struct_ide,代碼行數:31,代碼來源:ResultViewer.java

示例6: Content

import org.fife.ui.rtextarea.RTextScrollPane; //導入方法依賴的package包/類
public Content(){
	super(new BorderLayout());
	UIUtils.setMargin(this, new Insets(1,2,0,2));
	UIUtils.setUndecorated(this, true);
	editor = new Editor();
	theme.apply(editor);
	editorScroll = new RTextScrollPane(editor);
	editorScroll.getGutter().setBookmarkIcon(Icon.icon("bookmark"));
	editorScroll.getGutter().setBookmarkingEnabled(true);
	editorScroll.setVerticalScrollBarPolicy(RTextScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	UIUtils.setDrawBorder(editorScroll, false);
	studioPanel = new StudioPanel();
       // CardLayout
       card = new JPanel(new CardLayout());
       card.add(editorScroll, "Editor");
       card.add(studioPanel, "Studio");
       
       JPanel north = new JPanel(new VerticalFlowLayout());
       replacePanel = new ReplacePanel();
       north.add(replacePanel);
	add(north, BorderLayout.NORTH);
       add(card, BorderLayout.CENTER);
       
       JPanel vert = new JPanel(new VerticalFlowLayout());
       assetPanel = new AssetPanel();
       consolePanel = new ConsolePanel();
       assetPanel.setVisible(false);
       widgetPanel = new WidgetPanel();
       widgetPanel.setVisible(false);
       
       vert.add(widgetPanel);
       vert.add(assetPanel);
       vert.add(consolePanel);
       add(vert, BorderLayout.SOUTH);
       setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1, Style.border));
}
 
開發者ID:pyros2097,項目名稱:GdxStudio,代碼行數:37,代碼來源:Content.java

示例7: 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

示例8: 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.setVerticalScrollBarPolicy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。