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;
}
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;
}
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);
}
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);
}
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;
}
Aggregations