Search in sources :

Example 11 with JBTextArea

use of com.intellij.ui.components.JBTextArea in project midpoint-studio by Evolveum.

the class BrowseToolPanel method initQueryPanel.

private JComponent initQueryPanel() {
    JPanel root = new JPanel(new BorderLayout());
    DefaultActionGroup group = createQueryActionGroup();
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("BrowseQueryActions", group, true);
    toolbar.setTargetComponent(this);
    root.add(toolbar.getComponent(), BorderLayout.NORTH);
    query = new JBTextArea();
    JBScrollPane pane = new JBScrollPane(query);
    root.add(pane, BorderLayout.CENTER);
    return root;
}
Also used : JBTextArea(com.intellij.ui.components.JBTextArea) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 12 with JBTextArea

use of com.intellij.ui.components.JBTextArea in project GrepConsole by krasa.

the class MyGrepSearchTextArea method createJbTextArea.

private static JBTextArea createJbTextArea() {
    JBTextArea innerTextComponent = new JBTextArea();
    innerTextComponent.setRows(1);
    innerTextComponent.setColumns(12);
    innerTextComponent.setMinimumSize(new Dimension(100, 0));
    return innerTextComponent;
}
Also used : JBTextArea(com.intellij.ui.components.JBTextArea)

Example 13 with JBTextArea

use of com.intellij.ui.components.JBTextArea in project midpoint-studio by Evolveum.

the class OpResultRawPanel method initLayout.

private void initLayout() {
    text = new JBTextArea();
    add(new JBScrollPane(text), BorderLayout.CENTER);
    DefaultActionGroup group = new DefaultActionGroup();
    showChildren = new SimpleCheckboxAction("Show children") {

        @Override
        public void onStateChange() {
            nodeChange(currentNode, loaded);
        }
    };
    group.add(showChildren);
    loadAutomatically = new SimpleCheckboxAction("Load automatically");
    group.add(loadAutomatically);
    AnAction load = new AnAction("Load", "Load full log", AllIcons.Actions.Show) {

        @Override
        public void actionPerformed(@NotNull AnActionEvent e) {
            nodeChange(currentNode, true);
        }

        @Override
        public void update(@NotNull AnActionEvent e) {
            e.getPresentation().setEnabled(!loaded);
        }
    };
    group.add(load);
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("TraceViewVariablesToolbar", group, true);
    toolbar.setTargetComponent(this);
    add(toolbar.getComponent(), BorderLayout.NORTH);
}
Also used : SimpleCheckboxAction(com.evolveum.midpoint.studio.ui.SimpleCheckboxAction) JBTextArea(com.intellij.ui.components.JBTextArea) NotNull(org.jetbrains.annotations.NotNull) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 14 with JBTextArea

use of com.intellij.ui.components.JBTextArea in project visualgc_java8 by beansoft.

the class VisualHeap method main.

public static void main(String[] args) {
    JFrame frame = new JFrame();
    JBTextArea textArea = new JBTextArea() {

        public void setForeground(Color fg) {
            Color oldFg = Color.red;
            super.setForeground(oldFg);
        }
    };
    textArea.setCaretColor(JBColor.red);
    textArea.setForeground(JBColor.GRAY);
    textArea.setRows(8);
    textArea.setLineWrap(true);
    textArea.setText("Hello");
    frame.getContentPane().add(textArea);
    frame.pack();
    frame.setVisible(true);
}
Also used : JBColor(com.intellij.ui.JBColor) JBTextArea(com.intellij.ui.components.JBTextArea)

Example 15 with JBTextArea

use of com.intellij.ui.components.JBTextArea in project consulo by consulo.

the class SearchReplaceComponent method updateTextComponent.

private boolean updateTextComponent(boolean search) {
    JTextComponent oldComponent = search ? mySearchTextComponent : myReplaceTextComponent;
    if (oldComponent != null)
        return false;
    final MyTextComponentWrapper wrapper = search ? mySearchFieldWrapper : myReplaceFieldWrapper;
    final JBTextArea textComponent = new JBTextArea();
    textComponent.setRows(isMultiline() ? 2 : 1);
    textComponent.setColumns(12);
    if (search) {
        textComponent.getAccessibleContext().setAccessibleName(FindBundle.message("find.search.accessible.name"));
    } else {
        textComponent.getAccessibleContext().setAccessibleName(FindBundle.message("find.replace.accessible.name"));
    }
    SearchTextArea textArea = new SearchTextArea(textComponent, search);
    if (search) {
        myExtraSearchButtons.clear();
        myExtraSearchButtons.addAll(textArea.setExtraActions(myEmbeddedSearchActions.toArray(AnAction.EMPTY_ARRAY)));
    } else {
        myExtraReplaceButtons.clear();
        myExtraReplaceButtons.addAll(textArea.setExtraActions(myEmbeddedReplaceActions.toArray(AnAction.EMPTY_ARRAY)));
    }
    // Display empty text only when focused
    textComponent.putClientProperty("StatusVisibleFunction", (BooleanFunction<JTextComponent>) (c -> c.getText().isEmpty() && c.isFocusOwner()));
    wrapper.setContent(textArea);
    UIUtil.addUndoRedoActions(textComponent);
    textComponent.putClientProperty(UIUtil.HIDE_EDITOR_FROM_DATA_CONTEXT_PROPERTY, Boolean.TRUE);
    textComponent.setBackground(UIUtil.getTextFieldBackground());
    textComponent.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(final FocusEvent e) {
            textComponent.repaint();
        }

        @Override
        public void focusLost(final FocusEvent e) {
            textComponent.repaint();
        }
    });
    new CloseAction() {

        @Override
        public void actionPerformed(@Nonnull AnActionEvent e) {
            close();
        }
    }.registerCustomShortcutSet(KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_EDITOR_ESCAPE), textArea);
    return true;
}
Also used : JTextComponent(javax.swing.text.JTextComponent) JBTextArea(com.intellij.ui.components.JBTextArea)

Aggregations

JBTextArea (com.intellij.ui.components.JBTextArea)15 JBScrollPane (com.intellij.ui.components.JBScrollPane)7 NotNull (org.jetbrains.annotations.NotNull)4 SimpleCheckboxAction (com.evolveum.midpoint.studio.ui.SimpleCheckboxAction)3 JTextComponent (javax.swing.text.JTextComponent)3 AllIcons (com.intellij.icons.AllIcons)2 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)2 JBLabel (com.intellij.ui.components.JBLabel)2 BorderLayoutPanel (com.intellij.util.ui.components.BorderLayoutPanel)2 java.awt (java.awt)2 List (java.util.List)2 javax.swing (javax.swing)2 OpNode (com.evolveum.midpoint.schema.traces.OpNode)1 MidPointProjectNotifier (com.evolveum.midpoint.studio.impl.MidPointProjectNotifier)1 MidPointProjectNotifierAdapter (com.evolveum.midpoint.studio.impl.MidPointProjectNotifierAdapter)1 Format (com.evolveum.midpoint.studio.impl.trace.Format)1 FormattingContext (com.evolveum.midpoint.studio.impl.trace.FormattingContext)1 TreeTableColumnDefinition (com.evolveum.midpoint.studio.ui.TreeTableColumnDefinition)1 ViewingState (com.evolveum.midpoint.studio.ui.trace.ViewingState)1 Node (com.evolveum.midpoint.studio.ui.trace.entry.Node)1