use of javax.swing.border.EmptyBorder in project jmeter by apache.
the class RenderAsCssJQuery method createCssJqueryTasksPanel.
/**
* Create the CssJquery task pane
*
* @return CssJquery task pane
*/
private JPanel createCssJqueryTasksPanel() {
GridBagLayout g = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
JPanel cssJqueryActionPanel = new JPanel();
cssJqueryActionPanel.setLayout(g);
Border margin = new EmptyBorder(5, 5, 0, 5);
cssJqueryActionPanel.setBorder(margin);
// $NON-NLS-1$
cssJqueryField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_tester_field"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryField, c);
cssJqueryLabeledChoice = new JLabeledChoice(// $NON-NLS-1$
JMeterUtils.getResString("cssjquery_impl"), getImplementations());
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryLabeledChoice, c);
// $NON-NLS-1$
attributeField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_attribute"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 1;
cssJqueryActionPanel.add(attributeField, c);
// $NON-NLS-1$
JButton cssJqueryTester = new JButton(JMeterUtils.getResString("cssjquery_tester_button_test"));
cssJqueryTester.setActionCommand(CSSJQUEY_TESTER_COMMAND);
cssJqueryTester.addActionListener(this);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 1;
cssJqueryActionPanel.add(cssJqueryTester, c);
cssJqueryResultField = new JTextArea();
cssJqueryResultField.setEditable(false);
cssJqueryResultField.setLineWrap(true);
cssJqueryResultField.setWrapStyleWord(true);
JPanel cssJqueryTasksPanel = new JPanel(new BorderLayout(0, 5));
cssJqueryTasksPanel.add(cssJqueryActionPanel, BorderLayout.NORTH);
cssJqueryTasksPanel.add(GuiUtils.makeScrollPane(cssJqueryResultField), BorderLayout.CENTER);
return cssJqueryTasksPanel;
}
use of javax.swing.border.EmptyBorder in project jmeter by apache.
the class RenderAsXPath method createXpathExtractorTasksPanel.
/**
* Create the XPath task pane
*
* @return XPath task pane
*/
private JPanel createXpathExtractorTasksPanel() {
Box xpathActionPanel = Box.createVerticalBox();
Box selectorAndButton = Box.createHorizontalBox();
Border margin = new EmptyBorder(5, 5, 0, 5);
xpathActionPanel.setBorder(margin);
// $NON-NLS-1$
xpathExpressionField = new JLabeledTextField(JMeterUtils.getResString("xpath_tester_field"));
// $NON-NLS-1$
JButton xpathTester = new JButton(JMeterUtils.getResString("xpath_tester_button_test"));
xpathTester.setActionCommand(XPATH_TESTER_COMMAND);
xpathTester.addActionListener(this);
selectorAndButton.add(xpathExpressionField);
selectorAndButton.add(xpathTester);
xpathActionPanel.add(selectorAndButton);
xpathActionPanel.add(xmlConfPanel);
xpathActionPanel.add(getFragment);
xpathResultField = new JTextArea();
xpathResultField.setEditable(false);
xpathResultField.setLineWrap(true);
xpathResultField.setWrapStyleWord(true);
JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5));
xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH);
xpathTasksPanel.add(GuiUtils.makeScrollPane(xpathResultField), BorderLayout.CENTER);
return xpathTasksPanel;
}
use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.
the class DetectionExcludesConfigurable method createComponent.
@Nls
@Override
@NotNull
public JComponent createComponent() {
myEnabledDetectionCheckBox = new JCheckBox("Enable framework detection");
myEnabledDetectionCheckBox.setBorder(new EmptyBorder(10, 10, 0, 0));
final JBList excludesList = new JBList(myModel);
final ColoredListCellRenderer renderer = new ColoredListCellRenderer() {
JPanel panel = new JPanel(new BorderLayout());
{
panel.setBorder(new EmptyBorder(2, 10, 2, 0));
panel.add(this);
}
@Override
protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
setIconTextGap(4);
if (value instanceof ExcludeListItem) {
((ExcludeListItem) value).renderItem(this);
setBorder(new EmptyBorder(0, 10, 0, 0));
}
}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean selected, boolean hasFocus) {
super.getListCellRendererComponent(list, value, index, selected, hasFocus);
panel.setBackground(UIUtil.getListBackground(selected));
return panel;
}
};
renderer.setMyBorder(new EmptyBorder(0, 0, 0, 0));
excludesList.setCellRenderer(renderer);
final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(excludesList).disableUpAction().disableDownAction().setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
doAddAction(button);
}
});
decorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
myMainPanel = new JPanel(new BorderLayout(0, 5));
myMainPanel.add(myEnabledDetectionCheckBox, BorderLayout.NORTH);
final LabeledComponent<JPanel> excludesComponent = LabeledComponent.create(decorator.createPanel(), " Exclude from detection:");
myMainPanel.add(excludesComponent);
myEnabledDetectionCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GuiUtils.enableChildren(myEnabledDetectionCheckBox.isSelected(), excludesComponent);
}
});
myEnabledDetectionCheckBox.setSelected(true);
return myMainPanel;
}
use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.
the class CodeFragmentTableCellEditorBase method createEditorField.
protected EditorTextField createEditorField(Document document) {
EditorTextField field = new EditorTextField(document, myProject, myFileType) {
@Override
protected boolean shouldHaveBorder() {
return false;
}
};
field.setBorder(new EmptyBorder(1, 1, 1, 1));
return field;
}
use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.
the class CommonContentEntriesEditor method addContentEntryPanel.
protected void addContentEntryPanel(final String contentEntry) {
final ContentEntryEditor contentEntryEditor = createContentEntryEditor(contentEntry);
contentEntryEditor.initUI();
contentEntryEditor.addContentEntryEditorListener(myContentEntryEditorListener);
registerDisposable(new Disposable() {
@Override
public void dispose() {
contentEntryEditor.removeContentEntryEditorListener(myContentEntryEditorListener);
}
});
myEntryToEditorMap.put(contentEntry, contentEntryEditor);
Border border = BorderFactory.createEmptyBorder(2, 2, 0, 2);
final JComponent component = contentEntryEditor.getComponent();
final Border componentBorder = component.getBorder();
if (componentBorder != null) {
border = BorderFactory.createCompoundBorder(border, componentBorder);
}
component.setBorder(new EmptyBorder(0, 0, 0, 0));
myEditorsPanel.add(component);
}
Aggregations