Java Code Examples for javax.swing.JPanel#setName()

The following examples show how to use javax.swing.JPanel#setName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AdditionalWizardPanel.java    From netbeans with Apache License 2.0 8 votes vote down vote up
/** Gets component to display. Implements superclass abstract method. 
 * @return <code>AdditionalPanel</code> instance */
protected Component createComponent() {
    JPanel panel = new JPanel();
    
    //Accessibility
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AdditionalWizardPanel.class).getString("ACS_AdditionalWizardPanel"));                    
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(2));
    panel.setName(NbBundle.getBundle(getClass()).getString("TXT_ModifyAdditional"));
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);

    panel.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    constraints.fill = GridBagConstraints.BOTH;
    panel.add(getUI(), constraints);
    
    return panel;
}
 
Example 2
Source File: ResourceWizardPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());

    // Accessibility
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(ResourceWizardPanel.class).getString("ACS_ResourceWizardPanel"));                 
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(1));

    String msgKey = testWizard ? "TXT_SelectTestResource"       //NOI18N
                               : "TXT_SelectResource";          //NOI18N
    panel.setName(NbBundle.getMessage(ResourceWizardPanel.class, msgKey));
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);
    
    panel.add(getUI(), CARD_GUI);

    return panel;
}
 
Example 3
Source File: TestStringWizardPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());
    panel.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(
                    TestStringWizardPanel.class,
                    "ACS_TestStringWizardPanel"));              //NOI18N
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX,
                            Integer.valueOf(2));
    panel.setName(
            NbBundle.getMessage(TestStringWizardPanel.class,
                                "TXT_FoundMissingResource"));   //NOI18N
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);                    
    return panel;
}
 
Example 4
Source File: GlobalSearchDialog.java    From rapidminer-studio with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Sets up the GUI card responsible for displaying error information to the user.
 */
private void setupErrorGUI() {
	JPanel errorPanel = new JPanel();
	errorPanel.setName(CARD_ERROR);
	errorPanel.setLayout(new GridBagLayout());
	errorPanel.setOpaque(false);
	errorPanel.setBorder(TOP_BORDER);

	errorText = new JTextArea();
	errorText.setLineWrap(true);
	errorText.setWrapStyleWord(true);
	errorText.setForeground(ERROR_TEXT_COLOR);
	errorText.setBackground(Colors.WINDOW_BACKGROUND);
	errorText.setEditable(false);
	errorText.setBorder(null);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.weightx = 1.0d;
	gbc.weighty = 1.0d;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(5, 5, 5, 5);
	errorPanel.add(errorText, gbc);

	rootPanel.add(errorPanel, CARD_ERROR);
}
 
Example 5
Source File: GlobalSearchDialog.java    From rapidminer-studio with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Sets up the GUI card responsible for displaying no result information on an "All Studio" search to the user.
 */
private void setupNoResultGloballyGUI() {
	JPanel noResultPanel = new JPanel();
	noResultPanel.setName(CARD_NO_RESULTS_GLOBALLY);
	noResultPanel.setLayout(new GridBagLayout());
	GridBagConstraints gbc = new GridBagConstraints();

	noResultPanel.setOpaque(false);
	noResultPanel.setBorder(TOP_BORDER);

	// no results label
	JLabel noResults = new JLabel(I18N.getGUIMessage("gui.dialog.global_search.no_results.label"));
	noResults.setIcon(INFORMATION_ICON);
	noResults.setFont(noResults.getFont().deriveFont(FONT_SIZE_NO_RESULTS));
	noResults.setHorizontalAlignment(SwingConstants.LEFT);
	gbc.weightx = 1.0d;
	gbc.weighty = 1.0d;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(3, 10, 3, 10);
	noResultPanel.add(noResults, gbc);

	rootPanel.add(noResultPanel, CARD_NO_RESULTS_GLOBALLY);
}
 
Example 6
Source File: AbstractPanelBuilder.java    From raccoon4 with Apache License 2.0 5 votes vote down vote up
/**
 * Build the panel
 * 
 * @return the final panel.
 */
public final JPanel build(Globals globals) {
	this.globals = globals;
	JPanel ret = assemble();
	if (componentName != null) {
		ret.setName(componentName);
	}
	if (border != null) {
		ret.setBorder(border);
	}
	return ret;
}
 
Example 7
Source File: AdapterBuilder.java    From raccoon4 with Apache License 2.0 5 votes vote down vote up
@Override
protected JPanel assemble() {
	JPanel panel = new JPanel();
	panel.add(component);
	panel.setName(getClass().getName());
	return panel;
}
 
Example 8
Source File: SeaGlassOptionPaneUI.java    From seaglass with Apache License 2.0 5 votes vote down vote up
/**
 * Called from {@link #installComponents} to create a {@code Container}
 * containing the body of the message. The icon is the created by calling
 * {@link #addIcon}.
 */
@Override
protected Container createMessageArea() {
    JPanel top = new JPanel();
    top.setName("OptionPane.messageArea");
    top.setLayout(new BorderLayout());

    /* Fill the body. */
    Container body = new JPanel(new GridBagLayout());
    Container realBody = new JPanel(new BorderLayout());

    body.setName("OptionPane.body");
    realBody.setName("OptionPane.realBody");

    if (getIcon() != null) {
        JPanel sep = new JPanel();
        sep.setName("OptionPane.separator");
        sep.setPreferredSize(new Dimension(15, 1));
        realBody.add(sep, BorderLayout.BEFORE_LINE_BEGINS);
    }
    realBody.add(body, BorderLayout.CENTER);

    GridBagConstraints cons = new GridBagConstraints();
    cons.gridx = cons.gridy = 0;
    cons.gridwidth = GridBagConstraints.REMAINDER;
    cons.gridheight = 1;

    SeaGlassContext context = getContext(optionPane, ENABLED);
    cons.anchor = context.getStyle().getInt(context, "OptionPane.messageAnchor", GridBagConstraints.CENTER);
    context.dispose();

    cons.insets = new Insets(0, 0, 3, 0);

    addMessageComponents(body, cons, getMessage(), getMaxCharactersPerLineCount(), false);
    top.add(realBody, BorderLayout.CENTER);

    addIcon(top);
    return top;
}
 
Example 9
Source File: GlobalSearchDialog.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Sets up the GUI card responsible for displaying the actual search results to the user.
 */
private void setupResultsGUI() {
	mainPanel = new JPanel();
	mainPanel.setName(CARD_RESULTS);
	mainPanel.setLayout(new GridBagLayout());
	mainPanel.setBorder(MAIN_EMPTY_BORDER);

	mainPanelGbc = new GridBagConstraints();
	mainPanelGbc.gridx = 0;
	mainPanelGbc.gridy = 0;
	mainPanelGbc.weightx = 1.0d;
	mainPanelGbc.fill = GridBagConstraints.HORIZONTAL;
	mainPanelGbc.anchor = GridBagConstraints.NORTH;

	// add category panels now
	List<GlobalSearchCategory> categories = GlobalSearchGUIUtilities.INSTANCE.sortCategories(GlobalSearchRegistry.INSTANCE.getAllSearchCategories());
	for (GlobalSearchCategory category : categories) {
		addGUIForCategory(category);
	}

	// filler at bottom so they are sitting nicely at the top
	int previousGridY = mainPanelGbc.gridy;
	mainPanelGbc.gridy = FILLER_GRID_Y;
	mainPanelGbc.weighty = 1.0d;
	mainPanelGbc.fill = GridBagConstraints.BOTH;
	mainPanel.add(new JLabel(), mainPanelGbc);

	// reset layout so later additions are above the filler
	mainPanelGbc.gridy = previousGridY;
	mainPanelGbc.weighty = 0.0d;
	mainPanelGbc.fill = GridBagConstraints.NONE;

	rootPanel.add(mainPanel, CARD_RESULTS);
}
 
Example 10
Source File: PortMapperView.java    From portmapper with GNU General Public License v3.0 5 votes vote down vote up
private JComponent getMappingsPanel() {
    // Mappings panel

    final ActionMap actionMap = this.getContext().getActionMap(this.getClass(), this);

    tableModel = new PortMappingsTableModel(app);
    mappingsTable = new JTable(tableModel);
    mappingsTable.setAutoCreateRowSorter(true);
    mappingsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mappingsTable.setSize(new Dimension(400, 100));
    mappingsTable.getSelectionModel().addListSelectionListener(
            e -> firePropertyChange(PROPERTY_MAPPING_SELECTED, false, isMappingSelected()));

    final JScrollPane mappingsTabelPane = new JScrollPane();
    mappingsTabelPane.setViewportView(mappingsTable);

    final JPanel mappingsPanel = new JPanel(new MigLayout("", "[fill,grow]", "[grow,fill][]"));
    mappingsPanel.setName("port_mappings");
    final Border panelBorder = BorderFactory
            .createTitledBorder(app.getResourceMap().getString("mainFrame.port_mappings.title"));
    mappingsPanel.setBorder(panelBorder);
    mappingsPanel.add(mappingsTabelPane, "height 100::, span 2, wrap");

    mappingsPanel.add(new JButton(actionMap.get(ACTION_REMOVE_MAPPINGS)), "");
    mappingsPanel.add(new JButton(actionMap.get(ACTION_UPDATE_PORT_MAPPINGS)), "wrap");
    return mappingsPanel;
}
 
Example 11
Source File: ShowInstructionInfoPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void createStatusPanels() {
	instructionPanel = new JPanel(new BorderLayout());
	instructionLabel = new GDLabel("                         ");
	instructionPanel.setPreferredSize(
		new Dimension(200, instructionLabel.getPreferredSize().height));
	instructionLabel.setToolTipText(CURRENT_INSTRUCTION_PREPEND_STRING);
	instructionPanel.add(instructionLabel);
	instructionPanel.setName("Current Instruction");
	tool.addStatusComponent(instructionPanel, true, false);

	functionPanel = new JPanel(new BorderLayout());
	functionLabel = new GDLabel("                   ");
	functionLabel.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			if (e.getClickCount() != 2) {
				return;
			}

			goToSurroundingFunction();
		}
	});
	functionPanel.setPreferredSize(new Dimension(130, functionLabel.getPreferredSize().height));
	functionLabel.setToolTipText("Current Function");
	functionPanel.add(functionLabel);
	functionPanel.setName("Current Function");
	tool.addStatusComponent(functionPanel, true, false);

	addressPanel = new JPanel(new BorderLayout());
	addressLabel = new GDLabel("          ");
	addressPanel.setPreferredSize(new Dimension(95, addressLabel.getPreferredSize().height));
	addressLabel.setToolTipText("Current Address");
	addressPanel.add(addressLabel);
	addressPanel.setName("Current Address");
	tool.addStatusComponent(addressPanel, true, false);
}
 
Example 12
Source File: MosaicExpressionsPanel.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private JPanel createConditionsButtonPanel(String labelName) {
    final JPanel conditionButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
    conditionButtonsPanel.setName(labelName);

    final Component newConditionButton = createNewConditionButton();
    newConditionButton.setName(labelName + "_newCondition");
    conditionButtonsPanel.add(newConditionButton);

    final Component removeConditionButton = createRemoveConditionButton();
    removeConditionButton.setName(labelName + "_removeCondition");
    conditionButtonsPanel.add(removeConditionButton);

    final Component moveConditionUpButton = createMoveConditionUpButton();
    moveConditionUpButton.setName(labelName + "moveConditionUp");
    conditionButtonsPanel.add(moveConditionUpButton);

    final Component moveConditionDownButton = createMoveConditionDownButton();
    moveConditionDownButton.setName(labelName + "moveConditionDown");
    conditionButtonsPanel.add(moveConditionDownButton);

    bindingCtx.addPropertyChangeListener("updateMode", new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            final boolean enabled = Boolean.FALSE.equals(evt.getNewValue());
            newConditionButton.setEnabled(enabled);
            removeConditionButton.setEnabled(enabled);
            moveConditionUpButton.setEnabled(enabled);
            moveConditionDownButton.setEnabled(enabled);
        }
    });

    return conditionButtonsPanel;
}
 
Example 13
Source File: MosaicExpressionsPanel.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private JPanel createVariablesButtonPanel(String labelName) {
    final JPanel variableButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
    variableButtonsPanel.setName(labelName);

    final Component bandFilterButton = createBandFilterButton();
    bandFilterButton.setName(labelName + "_bandFilter");
    variableButtonsPanel.add(bandFilterButton);

    final Component newVariableButton = createNewVariableButton();
    newVariableButton.setName(labelName + "_newVariable");
    variableButtonsPanel.add(newVariableButton);

    final Component removeVariableButton = createRemoveVariableButton();
    removeVariableButton.setName(labelName + "_removeVariable");
    variableButtonsPanel.add(removeVariableButton);

    final Component moveVariableUpButton = createMoveVariableUpButton();
    moveVariableUpButton.setName(labelName + "moveVariableUp");
    variableButtonsPanel.add(moveVariableUpButton);

    final Component moveVariableDownButton = createMoveVariableDownButton();
    moveVariableDownButton.setName(labelName + "moveVariableDown");
    variableButtonsPanel.add(moveVariableDownButton);
    bindingCtx.addPropertyChangeListener("updateMode", new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            final boolean enabled = Boolean.FALSE.equals(evt.getNewValue());
            bandFilterButton.setEnabled(enabled);
            newVariableButton.setEnabled(enabled);
            removeVariableButton.setEnabled(enabled);
            moveVariableUpButton.setEnabled(enabled);
            moveVariableDownButton.setEnabled(enabled);

        }
    });
    return variableButtonsPanel;
}
 
Example 14
Source File: HardStringWizardPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());
    
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(HardStringWizardPanel.class).getString("ACS_HardStringWizardPanel"));//NOI18N
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(3));
    panel.setName(NbBundle.getBundle(HardStringWizardPanel.class).getString("TXT_ModifyStrings"));//NOI18N
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);        

    return panel;
}
 
Example 15
Source File: GuiActions.java    From libreveris with GNU Lesser General Public License v3.0 4 votes vote down vote up
private JDialog createAboutBox ()
{
    StringBuilder rows = new StringBuilder("pref,10dlu,pref,5dlu");

    for (int i = 0; i < (Topic.values().length); i++) {
        rows.append(",pref,3dlu");
    }

    // Layout
    final FormLayout layout = new FormLayout(
            "right:pref, 5dlu, pref, 200dlu",
            rows.toString());
    final PanelBuilder builder = new PanelBuilder(layout);
    final CellConstraints cst = new CellConstraints();

    builder.setDefaultDialogBorder();

    int iRow = 1;

    URI uri = UriUtil.toURI(WellKnowns.RES_URI, "splash.png");

    try {
        JPanel logoPanel = new ImagePanel(uri);
        builder.add(logoPanel, cst.xyw(1, iRow, 4));
    } catch (MalformedURLException ex) {
        logger.warn("Error on " + uri, ex);
    }

    iRow += 2;

    JLabel titleLabel = new JLabel();
    titleLabel.setName("aboutTitleLabel");
    builder.add(titleLabel, cst.xyw(1, iRow, 3));

    for (Topic topic : Topic.values()) {
        iRow += 2;

        JLabel label = new JLabel();
        label.setName(topic + "Label");
        builder.add(label, cst.xy(1, iRow));

        topic.comp.setName(topic + "TextField");
        topic.comp.setEditable(false);
        topic.comp.setBorder(null);
        topic.comp.setBackground(Color.WHITE);

        if (topic.comp instanceof JEditorPane) {
            ((JEditorPane) topic.comp).addHyperlinkListener(
                    linkListener);
        }

        builder.add(topic.comp, cst.xy(3, iRow));
    }

    JPanel panel = builder.getPanel();
    panel.setOpaque(true);
    panel.setBackground(Color.WHITE);
    panel.setName("panel");

    JDialog dialog = new JDialog();
    dialog.setName("aboutDialog");
    dialog.add(panel, BorderLayout.CENTER);

    // Manual injection
    resource.injectComponents(dialog);
    Topic.version.comp.setText(
            WellKnowns.TOOL_REF + ":" + WellKnowns.TOOL_BUILD);
    Topic.classes.comp.setText(WellKnowns.CLASS_CONTAINER.toString());
    Topic.license.comp.setText("GNU GPL V2");

    Topic.javaVendor.comp.setText(System.getProperty("java.vendor"));
    Topic.javaVersion.comp.setText(System.getProperty("java.version"));
    Topic.javaRuntime.comp.setText(
            System.getProperty("java.runtime.name") + " (build "
            + System.getProperty("java.runtime.version") + ")");
    Topic.javaVm.comp.setText(
            System.getProperty("java.vm.name") + " (build "
            + System.getProperty("java.vm.version") + ", "
            + System.getProperty("java.vm.info") + ")");
    Topic.os.comp.setText(
            System.getProperty("os.name") + " "
            + System.getProperty("os.version"));
    Topic.osArch.comp.setText(System.getProperty("os.arch"));

    return dialog;
}
 
Example 16
Source File: GuiActions.java    From audiveris with GNU Affero General Public License v3.0 4 votes vote down vote up
private JDialog createAboutBox ()
{
    StringBuilder rows = new StringBuilder("pref,10dlu,pref,5dlu");

    for (int i = 0; i < (Topic.values().length); i++) {
        rows.append(",pref,3dlu");
    }

    // Layout
    final FormLayout layout = new FormLayout(
            "right:pref, 5dlu, pref, 200dlu",
            rows.toString());
    final PanelBuilder builder = new PanelBuilder(layout);
    final CellConstraints cst = new CellConstraints();

    ///builder.setDefaultDialogBorder();
    int iRow = 1;

    URI uri = UriUtil.toURI(WellKnowns.RES_URI, "splash.png");

    try {
        JPanel logoPanel = new ImagePanel(uri);
        builder.add(logoPanel, cst.xyw(1, iRow, 4));
    } catch (MalformedURLException ex) {
        logger.warn("Error on " + uri, ex);
    }

    iRow += 2;

    JLabel titleLabel = new JLabel();
    titleLabel.setName("aboutTitleLabel");
    builder.add(titleLabel, cst.xyw(1, iRow, 3));

    for (Topic topic : Topic.values()) {
        iRow += 2;

        JLabel label = new JLabel();
        label.setName(topic + "Label");
        builder.add(label, cst.xy(1, iRow));

        topic.comp.setName(topic + "TextField");
        topic.comp.setEditable(false);
        topic.comp.setBorder(null);
        topic.comp.setBackground(Color.WHITE);

        if (topic.comp instanceof JEditorPane) {
            ((JEditorPane) topic.comp).addHyperlinkListener(linkListener);
        }

        builder.add(topic.comp, cst.xy(3, iRow));
    }

    JPanel panel = builder.getPanel();
    panel.setOpaque(true);
    panel.setBackground(Color.WHITE);
    panel.setName("panel");

    JDialog dialog = new JDialog();
    dialog.setName("aboutDialog");
    dialog.add(panel, BorderLayout.CENTER);

    // Manual injection
    resource.injectComponents(dialog);
    Topic.version.comp.setText(WellKnowns.TOOL_REF + ":" + WellKnowns.TOOL_BUILD);
    Topic.classes.comp.setText(WellKnowns.CLASS_CONTAINER.toString());
    Topic.license.comp.setText("GNU Affero GPL v3");

    Topic.ocr.comp.setText(TesseractOCR.getInstance().identify());

    Topic.javaVendor.comp.setText(System.getProperty("java.vendor"));
    Topic.javaVersion.comp.setText(System.getProperty("java.version"));
    Topic.javaRuntime.comp.setText(
            System.getProperty("java.runtime.name") + " (build "
                    + System.getProperty("java.runtime.version")
                    + ")");
    Topic.javaVm.comp.setText(
            System.getProperty("java.vm.name") + " (build "
                    + System.getProperty("java.vm.version")
                    + ", "
                    + System.getProperty("java.vm.info")
                    + ")");
    Topic.os.comp.setText(
            System.getProperty("os.name") + " " + System.getProperty("os.version"));
    Topic.osArch.comp.setText(System.getProperty("os.arch"));

    return dialog;
}
 
Example 17
Source File: GlobalSearchDialog.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Sets up the GUI card responsible for displaying no result information on a specific category search to the user.
 */
private void setupNoResultCategoryGUI() {
	JPanel noResultPanel = new JPanel();
	noResultPanel.setName(CARD_NO_RESULTS_IN_CATEGORY);
	noResultPanel.setLayout(new GridBagLayout());
	GridBagConstraints gbc = new GridBagConstraints();

	noResultPanel.setOpaque(false);
	noResultPanel.setBackground(Colors.TEXT_HIGHLIGHT_BACKGROUND);
	noResultPanel.setBorder(TOP_BORDER);

	// no results label
	JLabel noResults = new JLabel(I18N.getGUIMessage("gui.dialog.global_search.no_results.label"));
	noResults.setIcon(INFORMATION_ICON);
	noResults.setFont(noResults.getFont().deriveFont(FONT_SIZE_NO_RESULTS));
	noResults.setHorizontalAlignment(SwingConstants.LEFT);
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 0.0d;
	gbc.weighty = 1.0d;
	gbc.fill = GridBagConstraints.VERTICAL;
	gbc.anchor = GridBagConstraints.WEST;
	gbc.insets = new Insets(3, 10, 3, 0);
	noResultPanel.add(noResults, gbc);

	// filler in middle
	gbc.gridx += 1;
	gbc.weightx = 1.0d;
	gbc.weighty = 1.0d;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(0, 0, 0, 0);
	noResultPanel.add(new JLabel(), gbc);

	// "Try searching everywhere" button
	final ResourceAction action = new ResourceAction("global_search.search_all_instead") {

		@Override
		public void loggedActionPerformed(ActionEvent e) {
			controller.searchAllCategories();
		}
	};
	LinkLocalButton searchAllButton = new LinkLocalButton(action);
	GlobalSearchResultPanel wrapperPanel = new GlobalSearchResultPanel(null);
	wrapperPanel.add(searchAllButton);
	wrapperPanel.setActivationAction(action);

	gbc.gridx += 1;
	gbc.gridy = 0;
	gbc.weightx = 1.0d;
	gbc.fill = GridBagConstraints.VERTICAL;
	gbc.insets = new Insets(3, 0, 3, 5);
	gbc.anchor = GridBagConstraints.EAST;
	noResultPanel.add(wrapperPanel, gbc);

	rootPanel.add(noResultPanel, CARD_NO_RESULTS_IN_CATEGORY);
}
 
Example 18
Source File: DefaultTabbedContainerUI.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
 * Create the component which will contain the content (the components which
 * correspond to tabs).  The default implementation simply returns a
 * vanilla, unadorned <code>JPanel</code>.
 */
protected JPanel createContentDisplayer() {
    JPanel result = new JPanel();
    result.setName ("Content displayer"); //NOI18N
    return result;
}
 
Example 19
Source File: CheckoutForm.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    createUIComponents();
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(10, 3, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.setName("");
    final JLabel label1 = new JLabel();
    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.SelectRepository"));
    contentPanel.add(label1, new GridConstraints(1, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    repositoryFilter = new JTextField();
    repositoryFilter.setName("");
    contentPanel.add(repositoryFilter, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    final JLabel label2 = new JLabel();
    this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.ParentDirectory"));
    contentPanel.add(label2, new GridConstraints(5, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JLabel label3 = new JLabel();
    this.$$$loadLabelText$$$(label3, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.DirectoryName"));
    contentPanel.add(label3, new GridConstraints(7, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    directoryName = new JTextField();
    directoryName.setName("");
    contentPanel.add(directoryName, new GridConstraints(8, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    contentPanel.add(userAccountPanel, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    repositoryTableScrollPane = new JScrollPane();
    contentPanel.add(repositoryTableScrollPane, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    repositoryTable = new JTable();
    repositoryTable.setFillsViewportHeight(true);
    repositoryTable.setName("");
    repositoryTable.setShowHorizontalLines(false);
    repositoryTable.setShowVerticalLines(false);
    repositoryTableScrollPane.setViewportView(repositoryTable);
    parentDirectory = new TextFieldWithBrowseButton();
    contentPanel.add(parentDirectory, new GridConstraints(6, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    helpPanel = new HelpPanel();
    helpPanel.setHelpText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.helpText"));
    helpPanel.setPopupText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.Instructions"));
    contentPanel.add(helpPanel, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    advancedCheckBox = new JCheckBox();
    advancedCheckBox.setText("example text");
    contentPanel.add(advancedCheckBox, new GridConstraints(9, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    busySpinner = new BusySpinnerPanel();
    contentPanel.add(busySpinner, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    refreshButton.setToolTipText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CheckoutDialog.RefreshButton.ToolTip"));
    contentPanel.add(refreshButton, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
 
Example 20
Source File: MoreOptionsPane.java    From snap-desktop with GNU General Public License v3.0 4 votes vote down vote up
MoreOptionsPane(ColorManipulationForm colorManipulationForm, boolean collapsed) {
    this.colorManipulationForm = colorManipulationForm;

    if (icons == null) {
        icons = new ImageIcon[]{
                UIUtils.loadImageIcon("icons/PanelUp12.png"),
                UIUtils.loadImageIcon("icons/PanelDown12.png"),
        };
        rolloverIcons = new ImageIcon[]{
                ToolButtonFactory.createRolloverIcon(icons[0]),
                ToolButtonFactory.createRolloverIcon(icons[1]),
        };
    }

    // printDefaults(UIManager.getLookAndFeelDefaults(), "UIManager.getLookAndFeelDefaults()");

    headerLabels = new JLabel[]{
            new JLabel("More Options"),
            new JLabel("Less Options"),
    };
    Color headerLabelColor = UIManager.getLookAndFeelDefaults().getColor("TitledBorder.titleColor");
    if (headerLabelColor != null) {
        headerLabels[0].setForeground(headerLabelColor);
        headerLabels[1].setForeground(headerLabelColor);
    }

    this.component = new JLabel(); // dummy
    this.collapsed = collapsed;

    headerButton = ToolButtonFactory.createButton(icons[0], false);
    headerButton.setName("MoreOptionsPane.headerButton");
    headerButton.addActionListener(e -> setCollapsed(!isCollapsed()));

    final JPanel titleBar = new JPanel(new BorderLayout(2, 2));
    titleBar.add(headerButton, BorderLayout.WEST);
    headerSeparator = new TitledSeparator(headerLabels[0], TitledSeparator.TYPE_PARTIAL_ETCHED, SwingConstants.LEFT);
    headerSeparator.setName("MoreOptionsPane.headerSeparator");
    titleBar.add(headerSeparator, BorderLayout.CENTER);

    contentPanel = new JPanel(new BorderLayout(2, 2));
    contentPanel.add(titleBar, BorderLayout.NORTH);
    contentPanel.setName("MoreOptionsPane.contentPanel");
}