javax.swing.LayoutStyle Java Examples

The following examples show how to use javax.swing.LayoutStyle. 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: ResourceWrapperEditor.java    From netbeans with Apache License 2.0 7 votes vote down vote up
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null)
        return delegateEditor.getCustomEditor();

    JPanel panel = new JPanel();
    Component delComp = delegateEditor.getCustomEditor();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setHorizontalGroup(layout.createParallelGroup()
            .addComponent(delComp)
            .addGroup(layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(resourcePanelGUI)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)));
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addComponent(delComp).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(resourcePanelGUI));

    return panel;
}
 
Example #2
Source File: SwingAppLibDownloader.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static JPanel searchingPanel(JLabel progressLabel, JComponent progressComponent) {
    JPanel panel = new JPanel();
    progressLabel.setLabelFor(progressComponent);
    javax.swing.GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(progressLabel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(progressComponent, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(96, 96, 96)
            .addComponent(progressLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(progressComponent, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(109, Short.MAX_VALUE))
    );
    return panel;
}
 
Example #3
Source File: OperationDescriptionPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/);
    GroupLayout.SequentialGroup seq = layout.createSequentialGroup ();
    if (hasPrimary) {
        seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addGap (0, 30, 30);
    }
    if (hasRequired) {
        seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
                .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED);
    }
    res.addGroup (seq);
    return res;
}
 
Example #4
Source File: CssPrepOptionsPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void init() {
    errorLabel.setText(" "); // NOI18N
    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup();
    containerPanelLayout.setHorizontalGroup(horizontalGroup);
    containerPanelLayout.setVerticalGroup(
        containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(verticalGroup)
    );
    for (CssPreprocessorUIImplementation.Options options : allOptions) {
        JComponent component = options.getComponent();
        Parameters.notNull("component", component); // NOI18N
        horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
        verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    }
}
 
Example #5
Source File: TestingProviderPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    notActiveLabel = new JLabel();
    providerPanel = new JPanel();

    Mnemonics.setLocalizedText(notActiveLabel, NbBundle.getMessage(TestingProviderPanel.class, "TestingProviderPanel.notActiveLabel.text")); // NOI18N

    providerPanel.setLayout(new BorderLayout());

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(notActiveLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGap(0, 0, 0))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(notActiveLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}
 
Example #6
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        this);
    return Box.createVerticalStrut(height);
}
 
Example #7
Source File: AttachmentsPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void createAttachment (AttachmentInfo newAttachment) {
    AttachmentPanel attachment = new AttachmentPanel(nbCallback);
    attachment.setBackground(UIUtils.getSectionPanelBackground());
    horizontalGroup.addComponent(attachment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    verticalGroup.addComponent(attachment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    if (noneLabel.isVisible()) {
        noneLabel.setVisible(false);
        switchHelper();
        updateButtonText(false);
    }
    attachment.addPropertyChangeListener(getDeletedListener());
    
    if (newAttachment != null) {
        attachment.setAttachment(newAttachment.getFile(), newAttachment.getDescription(),
                newAttachment.getContentType(), newAttachment.isPatch());
    }
    if(nbCallback != null) {
        File f = new File(Places.getUserDirectory(), nbCallback.getLogFilePath()); 
        if(f.exists()) {
            attachment.setAttachment(f, nbCallback.getLogFileDescription(), nbCallback.getLogFileContentType(), false); // NOI18N
        }
        attachment.browseButton.setEnabled(false);
        attachment.fileField.setEnabled(false);
        attachment.fileTypeCombo.setEnabled(false);
        attachment.patchChoice.setEnabled(false);
    } else {
        attachment.viewButton.setVisible(false);
    }

    newAttachments.add(attachment);
    UIUtils.keepFocusedComponentVisible(attachment, parentPanel);
    revalidate();
    attachment.addChangeListener(getChangeListener());
    attachment.fileField.requestFocus();
    if (nbCallback != null) {
        supp.fireChange();
    }
}
 
Example #8
Source File: FrameworksPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    scrollCategories = new JScrollPane();
    listCategories = new JList<String>();
    panelContent = new JPanel();

    listCategories.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scrollCategories.setViewportView(listCategories);

    panelContent.setLayout(new BorderLayout());

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(scrollCategories, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(panelContent, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
            .addGap(0, 0, 0))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(0, 0, 0)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(scrollCategories, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
                .addComponent(panelContent, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
    );
}
 
Example #9
Source File: CodeceptionCreateTestPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    commandLabel = new JLabel();
    generateComboBox = new JComboBox<Codecept.GenerateCommand>();
    suiteLabel = new JLabel();
    suitesComboBox = new JComboBox<String>();

    commandLabel.setLabelFor(generateComboBox);
    Mnemonics.setLocalizedText(commandLabel, NbBundle.getMessage(CodeceptionCreateTestPanel.class, "CodeceptionCreateTestPanel.commandLabel.text")); // NOI18N

    suiteLabel.setLabelFor(suitesComboBox);
    Mnemonics.setLocalizedText(suiteLabel, NbBundle.getMessage(CodeceptionCreateTestPanel.class, "CodeceptionCreateTestPanel.suiteLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(commandLabel)
                .addComponent(suiteLabel))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(generateComboBox, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(suitesComboBox, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGap(0, 0, 0))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(commandLabel)
                .addComponent(generateComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(suiteLabel)
                .addComponent(suitesComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
    );
}
 
Example #10
Source File: CodeSnifferCustomizerPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    standardLabel = new JLabel();
    standardComboBox = new JComboBox<>();
    enabledCheckBox = new JCheckBox();

    Mnemonics.setLocalizedText(standardLabel, NbBundle.getMessage(CodeSnifferCustomizerPanel.class, "CodeSnifferCustomizerPanel.standardLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(enabledCheckBox, NbBundle.getMessage(CodeSnifferCustomizerPanel.class, "CodeSnifferCustomizerPanel.enabledCheckBox.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(standardLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(standardComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
        .addComponent(enabledCheckBox)
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addComponent(enabledCheckBox)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(standardLabel)
                .addComponent(standardComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
    );
}
 
Example #11
Source File: NewFileNamespacePanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    namespaceLabel = new JLabel();
    namespaceComboBox = new JComboBox<String>();

    Mnemonics.setLocalizedText(namespaceLabel, NbBundle.getMessage(NewFileNamespacePanelVisual.class, "NewFileNamespacePanelVisual.namespaceLabel.text")); // NOI18N

    namespaceComboBox.setEditable(true);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(namespaceLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(namespaceComboBox, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(namespaceLabel)
            .addComponent(namespaceComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
    );
}
 
Example #12
Source File: ExpandableMessage.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static Component makeVerticalStrut(JComponent compA,
                                           JComponent compB) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    return Box.createVerticalStrut(
            layoutStyle.getPreferredGap(compA,
                                        compB,
                                        UNRELATED,
                                        SOUTH,
                                        compA.getParent()));
}
 
Example #13
Source File: CSSStylesSelectionPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Builds the layout of the rendered component.
 */
private void buildLayout() {
    GroupLayout layout = new GroupLayout(renderer);
    GroupLayout.Group hGroup = layout.createSequentialGroup()
            .addComponent(selectorLabel, 1, 1, Short.MAX_VALUE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup()
                .addComponent(matchedNodeLabel, 1, 1, Short.MAX_VALUE)
                .addComponent(ruleLocationPanel, 1, 1, Short.MAX_VALUE)
            );
    GroupLayout.Group vGroup = layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(selectorLabel)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(matchedNodeLabel)
                    .addComponent(ruleLocationPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                ))
            .addGap(0, 0, Short.MAX_VALUE);
    hGroup = layout.createParallelGroup()
            .addComponent(mediaLabel, 1, 1, Short.MAX_VALUE)
            .addGroup(hGroup);
    vGroup = layout.createSequentialGroup()
            .addComponent(mediaLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(vGroup);
    layout.setHorizontalGroup(hGroup);
    layout.setVerticalGroup(vGroup);
    renderer.setLayout(layout);
    Color borderColor = UIManager.getColor("Label.background"); // NOI18N
    renderer.setBorder(BorderFactory.createCompoundBorder(
        BorderFactory.createMatteBorder(0, 0, 1, 0, borderColor),
        BorderFactory.createEmptyBorder(2, 2, 2, 2)));
}
 
Example #14
Source File: CustomizerJsTesting.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form
 * Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    providerLabel = new JLabel();
    providerComboBox = new JComboBox<JsTestingProvider>();
    separator = new JSeparator();
    providerPanel = new JPanel();

    providerLabel.setLabelFor(providerComboBox);
    Mnemonics.setLocalizedText(providerLabel, NbBundle.getMessage(CustomizerJsTesting.class, "CustomizerJsTesting.providerLabel.text")); // NOI18N

    providerPanel.setLayout(new BorderLayout());

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(layout.createSequentialGroup()
            .addComponent(providerLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
        .addComponent(separator)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(providerLabel)
                .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separator, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}
 
Example #15
Source File: SelectProviderPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    providerLabel = new JLabel();
    providerComboBox = new JComboBox<JsTestingProvider>();

    providerLabel.setLabelFor(providerComboBox);
    Mnemonics.setLocalizedText(providerLabel, NbBundle.getMessage(SelectProviderPanel.class, "SelectProviderPanel.providerLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(providerLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(providerLabel)
                .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addGap(0, 0, Short.MAX_VALUE))
    );
}
 
Example #16
Source File: CssStylesPanelProviderImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the "Run File" panel.
 */
private void initRunFilePanel() {
    runFilePanel = new JPanel();
    JLabel label = new JLabel(NbBundle.getMessage(CssStylesPanelProviderImpl.class, "CssStylesPanelProviderImpl.runFileLabel")); // NOI18N
    label.setHorizontalAlignment(SwingConstants.CENTER);
    runButton = new JButton();
    runButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FileObject lastRelatedFileObject = getLastRelatedFileObject();
            if (lastRelatedFileObject != null) {
                ActionProvider provider = actionProviderForFileObject(lastRelatedFileObject);
                if (provider != null) {
                    Lookup context = contextForFileObject(lastRelatedFileObject);
                    if (provider.isActionEnabled(ActionProvider.COMMAND_RUN_SINGLE, context)) {
                        provider.invokeAction(ActionProvider.COMMAND_RUN_SINGLE, context);
                    }
                }
            }
        }
    });
    GroupLayout layout = new GroupLayout(runFilePanel);
    runFilePanel.setLayout(layout);
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(label)
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(runButton)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    layout.setHorizontalGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
            .addComponent(label, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(runButton))
            .addContainerGap());
}
 
Example #17
Source File: GruntCustomizerPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    tasksLabel = new JLabel();
    tasksTextField = new JTextField();
    tasksInfoLabel = new JLabel();

    tasksLabel.setLabelFor(tasksTextField);
    Mnemonics.setLocalizedText(tasksLabel, NbBundle.getMessage(GruntCustomizerPanel.class, "GruntCustomizerPanel.tasksLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(tasksInfoLabel, NbBundle.getMessage(GruntCustomizerPanel.class, "GruntCustomizerPanel.tasksInfoLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(tasksLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(tasksInfoLabel)
                .addComponent(tasksTextField)))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(tasksLabel)
                .addComponent(tasksTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(tasksInfoLabel)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}
 
Example #18
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeHorizontalStrut(JComponent compA,
                                      JComponent compB,
                                      LayoutStyle.ComponentPlacement relatedUnrelated) {
    int width = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        WEST,
                        this);
    return Box.createHorizontalStrut(width);
}
 
Example #19
Source File: CustomizerDocumentation.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form
 * Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    providerLabel = new JLabel();
    providerComboBox = new JComboBox<PhpDocumentationProvider>();
    separator = new JSeparator();
    providerPanel = new JPanel();

    Mnemonics.setLocalizedText(providerLabel, NbBundle.getMessage(CustomizerDocumentation.class, "CustomizerDocumentation.providerLabel.text")); // NOI18N

    providerPanel.setLayout(new BorderLayout());

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(separator)
        .addGroup(layout.createSequentialGroup()
            .addComponent(providerLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
        .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(providerLabel)
                .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separator, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}
 
Example #20
Source File: VCSCommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    ComponentPlacement relatedUnrelated, 
                                    JPanel parent) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        parent);
    return Box.createVerticalStrut(height);
}
 
Example #21
Source File: VCSCommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static Component makeHorizontalStrut(JComponent compA,
                                          JComponent compB,
                                          ComponentPlacement relatedUnrelated,
                                          JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,
                            compB,
                            relatedUnrelated,
                            WEST,
                            parent);
        return Box.createHorizontalStrut(width);
}
 
Example #22
Source File: CommentsPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) {
    GroupLayout layout = new GroupLayout(headerPanel);
    headerPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(stateLabel);
    }
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(commentLabel,0, 0, Short.MAX_VALUE)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(rightLabel)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(mailtoButton);
    }
    layout.setHorizontalGroup(hGroup);
    
    GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        vGroup.addComponent(stateLabel);
    }
    vGroup.addComponent(commentLabel)
          .addComponent(rightLabel)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        vGroup.addComponent(mailtoButton);
    }
    layout.setVerticalGroup(vGroup);
}
 
Example #23
Source File: CssPreprocessorsCustomizerPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    configureButton = new JButton();
    mainTabbedPane = new JTabbedPane();

    Mnemonics.setLocalizedText(configureButton, NbBundle.getMessage(CssPreprocessorsCustomizerPanel.class, "CssPreprocessorsCustomizerPanel.configureButton.text")); // NOI18N
    configureButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            configureButtonActionPerformed(evt);
        }
    });

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(mainTabbedPane, GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        .addGroup(layout.createSequentialGroup()
            .addGap(0, 0, Short.MAX_VALUE)
            .addComponent(configureButton))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addComponent(configureButton)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(mainTabbedPane, GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE))
    );
}
 
Example #24
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        this);
    return Box.createVerticalStrut(height);
}
 
Example #25
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeHorizontalStrut(JComponent compA,
                                      JComponent compB,
                                      LayoutStyle.ComponentPlacement relatedUnrelated) {
    int width = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        WEST,
                        this);
    return Box.createHorizontalStrut(width);
}
 
Example #26
Source File: HgUtils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static JComponent addContainerBorder(JComponent comp) {
    final LayoutStyle layoutStyle = LayoutStyle.getInstance();

    JPanel panel = new JPanel();
    panel.add(comp);
    panel.setBorder(BorderFactory.createEmptyBorder(
            layoutStyle.getContainerGap(comp, SwingConstants.NORTH, null),
            layoutStyle.getContainerGap(comp, SwingConstants.WEST,  null),
            layoutStyle.getContainerGap(comp, SwingConstants.SOUTH, null),
            layoutStyle.getContainerGap(comp, SwingConstants.EAST,  null)));
    return panel;
}
 
Example #27
Source File: FakeJiraConnector.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JPanel createControllerPanel() {
    JPanel controllerPanel = new JPanel();

    JLabel pane = new JLabel();
    pane.setText(NbBundle.getMessage(FakeJiraConnector.class, "MSG_NOT_YET_INSTALLED")); // NOI18N

    JButton downloadButton = new JButton();
    downloadButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JiraUpdater.getInstance().downloadAndInstall(null);
        }
    });
    
    org.openide.awt.Mnemonics.setLocalizedText(downloadButton, org.openide.util.NbBundle.getMessage(FakeJiraConnector.class, "MissingJiraSupportPanel.downloadButton.text")); // NOI18N

    GroupLayout layout = new GroupLayout(controllerPanel);
    controllerPanel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(pane, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(downloadButton))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(GroupLayout.Alignment.LEADING)
    .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addComponent(pane)
        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(downloadButton))
        .addContainerGap())
    );

    return controllerPanel;
}
 
Example #28
Source File: RepositorySelectorBuilder.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static void addInsetsToPanel(JComponent comp) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    comp.setBorder(BorderFactory.createEmptyBorder(
            layoutStyle.getContainerGap(comp, NORTH, null),
            layoutStyle.getContainerGap(comp, WEST,  null),
            layoutStyle.getContainerGap(comp, SOUTH, null),
            layoutStyle.getContainerGap(comp, EAST,  null)));
}
 
Example #29
Source File: RepositorySelectorBuilder.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private int getSpace(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related, int horizontal) {
    return LayoutStyle.getInstance()
           .getPreferredGap(compA,
                            compB,
                            related,
                            (horizontal == HORIZONTAL) ? EAST : SOUTH,
                            parent);
}
 
Example #30
Source File: DebugWindow.java    From mapleLemon with GNU General Public License v2.0 5 votes vote down vote up
private void initComponents() {
    this.jScrollPane1 = new JScrollPane();
    this.jTextArea1 = new JTextArea();
    this.jButton1 = new JButton();
    this.jLabel1 = new JLabel();

    setDefaultCloseOperation(2);
    setTitle("调试窗口");
    setResizable(false);

    this.jTextArea1.setColumns(20);
    this.jTextArea1.setLineWrap(true);
    this.jTextArea1.setRows(5);
    this.jScrollPane1.setViewportView(this.jTextArea1);

    this.jButton1.setText("测试封包");
    this.jButton1.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            DebugWindow.this.jButton1ActionPerformed(evt);
        }
    });
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(this.jScrollPane1, -1, 446, 32767).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(this.jLabel1, -1, -1, 32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton1))).addContainerGap()));

    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(this.jScrollPane1, -1, 253, 32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addComponent(this.jButton1).addGroup(layout.createSequentialGroup().addGap(0, 0, 0).addComponent(this.jLabel1, -1, -1, 32767))).addContainerGap()));

    pack();
}