Java Code Examples for org.openide.awt.Mnemonics#setLocalizedText()

The following examples show how to use org.openide.awt.Mnemonics#setLocalizedText() . 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: Customizer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void createCustomButtons() {
    PaletteActions customActions = root.getLookup().lookup( PaletteActions.class );
    if( null == customActions )
        return;
    
    Action[] actions = customActions.getImportActions();
    if( null == actions || actions.length == 0 )
        return;
    
    customButtons = new JButton[actions.length];
    for( int i=0; i<actions.length; i++ ) {
        customButtons[i] = new JButton( actions[i] );
        if( null != actions[i].getValue( Action.NAME ) )
            Mnemonics.setLocalizedText( customButtons[i], actions[i].getValue( Action.NAME ).toString() );
        if( null != actions[i].getValue( Action.LONG_DESCRIPTION ) )
            customButtons[i].getAccessibleContext().setAccessibleDescription( actions[i].getValue( Action.LONG_DESCRIPTION ).toString() );
        java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = i;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 10);
        customActionsPanel.add( customButtons[i], gridBagConstraints);
    }
}
 
Example 2
Source File: ModifierPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    jLabel1 = new JLabel();        
    jLabel1.setLabelFor(accessCombo);
    Mnemonics.setLocalizedText(jLabel1, getString("LAB_AccessRights")); // NOI18N

    jPanel2 = new JPanel();
    jPanel2.setLayout(new java.awt.BorderLayout(8, 8));
    jPanel2.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
    jPanel2.add(jLabel1, java.awt.BorderLayout.WEST);
    jPanel2.add(accessCombo, java.awt.BorderLayout.CENTER);
    modifPanel.setBorder (new javax.swing.border.CompoundBorder(
                              new javax.swing.border.TitledBorder(getString("LAB_Modifiers")), // NOI18N
                              new javax.swing.border.EmptyBorder(new java.awt.Insets(3, 3, 3, 3))
                          ));
    
    commpactP = new JPanel();
    commpactP.setLayout(new java.awt.BorderLayout());
    commpactP.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(6, 7, 6, 7)));
    commpactP.add(modifPanel, java.awt.BorderLayout.CENTER);
    commpactP.add(jPanel2, java.awt.BorderLayout.NORTH);
    commpactP.getAccessibleContext().setAccessibleName("ACSN_ModifierPanel"); // NOI18N
    commpactP.getAccessibleContext().setAccessibleDescription(getString("ACSD_ModifierPanel")); // NOI18N
}
 
Example 3
Source File: HostsSorting.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private JMenuItem createPresenter() {
    final JMenu menu = new JMenu() {
        protected void fireMenuSelected() {
            Component[] items = getMenuComponents();
            for (Component item : items)
                if (item instanceof SortAction)
                    ((SortAction)item).updateAction();
        }
    };
    Mnemonics.setLocalizedText(menu, NbBundle.getMessage(HostsSorting.class,
                               "ACT_SortHosts")); // NOI18N

    menu.add(new SortAction(NbBundle.getMessage(HostsSorting.class,
                            "ACT_TimeAdded"), BY_TIME_COMPARATOR, sorter)); // NOI18N
    menu.add(new SortAction(NbBundle.getMessage(HostsSorting.class,
                            "ACT_DisplayName"), BY_NAME_COMPARATOR, sorter)); // NOI18N

    return menu;
}
 
Example 4
Source File: RefactoringPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Returns array of available buttons. Initially, it returns only
 * basic "do refactoring/cancel refactoring" button. Override this method, 
 * if you want to provide any other buttons with different action to be 
 * performed.
 *
 * @return  array of available buttons.
 */
private JButton[] getButtons() {
    checkEventThread();
    if (isQuery) {
        refactorButton = null;
        if (callback==null) {
            return new JButton[] {};
        } else {
            rerunButton = new JButton((String) callback.getValue(callback.NAME)); // NOI18N
            rerunButton.addActionListener(getButtonListener());
            return new JButton[] {rerunButton};
        }
    } else {
        refactorButton = new JButton(); // NOI18N
        Mnemonics.setLocalizedText(refactorButton, NbBundle.getMessage(RefactoringPanel.class, "LBL_DoRefactor"));
        refactorButton.setToolTipText(NbBundle.getMessage(RefactoringPanel.class, "HINT_DoRefactor")); // NOI18N
        refactorButton.addActionListener(getButtonListener());
        cancelButton = new JButton(NbBundle.getMessage(RefactoringPanel.class, "LBL_CancelRefactor")); // NOI18N
        Mnemonics.setLocalizedText(cancelButton, NbBundle.getMessage(RefactoringPanel.class, "LBL_CancelRefactor"));
        cancelButton.setToolTipText(NbBundle.getMessage(RefactoringPanel.class, "HINT_CancelRefactor")); // NOI18N
        cancelButton.addActionListener(getButtonListener());
        return new JButton[] {refactorButton, cancelButton};
    }
}
 
Example 5
Source File: UIUtil.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("LBL_IconInfo=Selected icon [size]:")
private static JPanel getAccesoryPanel(final JTextField iconInfo) {
    iconInfo.setColumns(15);
    iconInfo.setEditable(false);
    
    JPanel accessoryPanel = new JPanel();
    JPanel inner = new JPanel();
    JLabel iconInfoLabel = new JLabel();
    accessoryPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0));
    
    inner.setLayout(new GridLayout(2, 1, 0, 6));
    
    iconInfoLabel.setLabelFor(iconInfo);
    Mnemonics.setLocalizedText(iconInfoLabel, LBL_IconInfo());
    inner.add(iconInfoLabel);
    
    inner.add(iconInfo);
    
    accessoryPanel.add(inner);
    return accessoryPanel;
}
 
Example 6
Source File: SnapshotInfoPanel.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void initComponents() {
    setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
    setLayout(new BorderLayout(0, 5));

    JLabel textLabel = new JLabel();
    Mnemonics.setLocalizedText(textLabel, Bundle.SnapshotInfoPanel_UserCommentsLbl());

    textArea = new JTextArea();
    textLabel.setLabelFor(textArea);

    textArea.requestFocus();

    JScrollPane textAreaScroll = new JScrollPane(textArea);
    textAreaScroll.setPreferredSize(new Dimension(350, 150));
    add(textAreaScroll, BorderLayout.CENTER);
    add(textLabel, BorderLayout.NORTH);

    getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputPanel") // NOI18N
            );
    textArea.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputField") // NOI18N
            );
}
 
Example 7
Source File: NbPlatformCustomizer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages({
    "PROGRESS_checking_for_upgrade=Checking for old harnesses to upgrade",
    "CTL_Close=&Close",
    "CTL_NbPlatformManager_Title=NetBeans Platform Manager"
})
public static Object showCustomizer() {
    final AtomicBoolean canceled = new AtomicBoolean();
    ProgressUtils.runOffEventDispatchThread(new Runnable() { // #207451
        @Override public void run() {
            HarnessUpgrader.checkForUpgrade();
        }
    }, PROGRESS_checking_for_upgrade(), canceled, false);
    NbPlatformCustomizer customizer = new NbPlatformCustomizer();
    JButton closeButton = new JButton();
    Mnemonics.setLocalizedText(closeButton, CTL_Close());
    DialogDescriptor descriptor = new DialogDescriptor(
            customizer,
            CTL_NbPlatformManager_Title(),
            true,
            new Object[] {closeButton},
            closeButton,
            DialogDescriptor.DEFAULT_ALIGN,
            new HelpCtx("org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer"),
            null);
    Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);
    dlg.setVisible(true);
    dlg.dispose();
    return customizer.getSelectedNbPlatform();
}
 
Example 8
Source File: ExpandableMessage.java    From netbeans with Apache License 2.0 5 votes vote down vote up
ExpandableMessage(String topMsgKey,
                  Collection<String> messages,
                  String bottomMsgKey,
                  JButton toggleButton) {
    super(null);
    this.messages = messages;
    this.toggleButton = toggleButton;
    lblTopMsg = new JLabel(getMessage(topMsgKey));
    lblBotMsg = (bottomMsgKey != null)
                ? new JLabel(getMessage(bottomMsgKey))
                : null;

    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));

    add(lblTopMsg);
    lblTopMsg.setAlignmentX(LEFT_ALIGNMENT);

    if (lblBotMsg != null) {
        add(makeVerticalStrut(lblTopMsg, lblBotMsg));
        add(lblBotMsg);
        lblBotMsg.setAlignmentX(LEFT_ALIGNMENT);
    }

    Mnemonics.setLocalizedText(toggleButton,
                               getMessage("LBL_ShowMoreInformation")); //NOI18N
    toggleButton.addActionListener(this);
}
 
Example 9
Source File: DataDisplay.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static JLabel createHeaderLabel(String label, String ad, Component comp) {
JLabel jl = new JLabel();
       Mnemonics.setLocalizedText(jl, label);
Font labelFont = jl.getFont();
Font boldFont = labelFont.deriveFont(Font.BOLD);
jl.setFont(boldFont);
       if (ad != null)
           jl.getAccessibleContext().setAccessibleDescription(ad);
       if (comp != null)
           jl.setLabelFor(comp);
return jl;
   }
 
Example 10
Source File: URLPresenter.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Updates display text and tooltip of a specified presenter.
 *
 * @param  presenter  presenter whose name is to be updated
 */
private void updateName(AbstractButton presenter) {
    String name = dataObject.getName();

    try {
        FileObject file = dataObject.getPrimaryFile();
        name = file.getFileSystem().getDecorator().annotateName(name, dataObject.files());
    } catch (FileStateInvalidException fsie) {
        /* OK, so we use the default name */
    }

    Mnemonics.setLocalizedText(presenter, name);
}
 
Example 11
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 12
Source File: SelectFilePanel.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() {

    selectFileLabel = new JLabel();
    selectFileScrollPane = new JScrollPane();
    selectFileList = new JList<>();

    selectFileLabel.setLabelFor(selectFileList);
    Mnemonics.setLocalizedText(selectFileLabel, NbBundle.getMessage(SelectFilePanel.class, "SelectFilePanel.selectFileLabel.text")); // NOI18N

    selectFileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    selectFileScrollPane.setViewportView(selectFileList);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                .addComponent(selectFileLabel))
            .addContainerGap())
    );
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(selectFileLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
    );
}
 
Example 13
Source File: NotWebFolder.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initComponents() {
    JTextArea localTopMessage = new javax.swing.JTextArea();

    jCheckBox1 = new javax.swing.JCheckBox();
    
    setLayout(new java.awt.BorderLayout(0, 12));
    
    setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
    getAccessibleContext().setAccessibleDescription(msg);
    
    localTopMessage.setLineWrap (true);
    localTopMessage.setWrapStyleWord (true);
    localTopMessage.setEditable (false);
    localTopMessage.setEnabled (false);
    localTopMessage.setOpaque (false);
    localTopMessage.setDisabledTextColor (javax.swing.UIManager.getColor ("Label.foreground"));  // NOI18N
    localTopMessage.setFont (javax.swing.UIManager.getFont ("Label.font")); // NOI18N

    StringBuilder lTopMessage = new StringBuilder();
    lTopMessage.append(msg);
    localTopMessage.setText(lTopMessage.toString());
    add(localTopMessage, java.awt.BorderLayout.NORTH);
    
    Mnemonics.setLocalizedText(jCheckBox1, NbBundle.getMessage (NotWebFolder.class, "CTL_ShowDialog"));
    jCheckBox1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (NotWebFolder.class, "ACSD_CTL_ShowDialog"));
    add(jCheckBox1, java.awt.BorderLayout.SOUTH);
}
 
Example 14
Source File: RepositorySelectorBuilder.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void setLabelText(String text) {
    if (label == null) {
        labelText = text;
    } else {
        Mnemonics.setLocalizedText(label, text);
    }
}
 
Example 15
Source File: DefaultPlugin.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
     */
    private boolean informUserOnlyJUnit3Applicable(String sourceLevel) {
        // assert EventQueue.isDispatchThread(); #170707

        JComponent msg
              = createMessageComponent("MSG_cannot_use_default_junit4", //NOI18N
                                       sourceLevel);
//        Object selectOption = NbBundle.getMessage(
//                                    getClass(),
//                                    "LBL_create_junit3_tests");         //NOI18N
        JButton button = new JButton(); 
        Mnemonics.setLocalizedText(button, bundle.getString("LBL_Select"));
        button.getAccessibleContext().setAccessibleName("AN_create_junit3_tests");
        button.getAccessibleContext().setAccessibleDescription("AD_create_junit3_tests");
        
        Object answer = DialogDisplayer.getDefault().notify(
                new DialogDescriptor(
                        wrapDialogContent(msg),
                        NbBundle.getMessage(
                                getClass(),
                                "LBL_title_cannot_use_junit4"),         //NOI18N
                        true,       //modal
                        new Object[] {button, CANCEL_OPTION},
                        button,
                        DialogDescriptor.DEFAULT_ALIGN,
                        (HelpCtx) null,
                        (ActionListener) null));

        return answer == button;
    }
 
Example 16
Source File: PullImageAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "LBL_Pull=&Pull",
    "LBL_SearchImage=Search Image"
})
@Override
protected void performAction(Node[] activatedNodes) {
    DockerInstance instance = activatedNodes[0].getLookup().lookup(DockerInstance.class);
    if (instance != null) {
        JButton pullButton = new JButton();
        Mnemonics.setLocalizedText(pullButton, Bundle.LBL_Pull());
        DockerHubSearchPanel panel = new DockerHubSearchPanel(instance, pullButton);

        DialogDescriptor descriptor
                = new DialogDescriptor(panel, Bundle.LBL_SearchImage(),
                        true, new Object[]{pullButton, DialogDescriptor.CANCEL_OPTION}, pullButton,
                        DialogDescriptor.DEFAULT_ALIGN, null, null);
        descriptor.setClosingOptions(new Object[]{pullButton, DialogDescriptor.CANCEL_OPTION});
        Dialog dlg = null;

        try {
            dlg = DialogDisplayer.getDefault().createDialog(descriptor);
            dlg.setVisible(true);

            if (descriptor.getValue() == pullButton) {
                perform(instance, panel.getImage());
            }
        } finally {
            if (dlg != null) {
                dlg.dispose();
            }
        }
    }
}
 
Example 17
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initCollapsibleSections() {
    initSectionButton(filesSectionButton, filesSectionPanel,
                      "initFilesPanel",                             //NOI18N
                      DEFAULT_DISPLAY_FILES);
    if(!hooks.isEmpty()) {
        Mnemonics.setLocalizedText(hooksSectionButton, (hooks.size() == 1)
                                       ? hooks.iterator().next().getDisplayName()
                                       : getMessage("LBL_Advanced")); // NOI18N                 
        initSectionButton(hooksSectionButton, hooksSectionPanel,
                          "initHooksPanel",                         //NOI18N
                          DEFAULT_DISPLAY_HOOKS);
    } else {
        hooksSectionButton.setVisible(false);
    }
}
 
Example 18
Source File: NodeJsCustomizerPanel.java    From netbeans with Apache License 2.0 4 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() {

    nodeBbuttonGroup = new ButtonGroup();
    enabledCheckBox = new JCheckBox();
    configureNodeButton = new JButton();
    defaultNodeRadioButton = new JRadioButton();
    customNodeRadioButton = new JRadioButton();
    nodePathPanel = new JPanel();
    debugPortLabel = new JLabel();
    debugPortSpinner = new JSpinner();
    localDebugInfoLabel = new JLabel();
    syncCheckBox = new JCheckBox();

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

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

    nodeBbuttonGroup.add(defaultNodeRadioButton);
    Mnemonics.setLocalizedText(defaultNodeRadioButton, NbBundle.getMessage(NodeJsCustomizerPanel.class, "NodeJsCustomizerPanel.defaultNodeRadioButton.text")); // NOI18N

    nodeBbuttonGroup.add(customNodeRadioButton);
    Mnemonics.setLocalizedText(customNodeRadioButton, NbBundle.getMessage(NodeJsCustomizerPanel.class, "NodeJsCustomizerPanel.customNodeRadioButton.text")); // NOI18N

    nodePathPanel.setLayout(new BorderLayout());

    debugPortLabel.setLabelFor(debugPortSpinner);
    Mnemonics.setLocalizedText(debugPortLabel, NbBundle.getMessage(NodeJsCustomizerPanel.class, "NodeJsCustomizerPanel.debugPortLabel.text")); // NOI18N

    debugPortSpinner.setEditor(new JSpinner.NumberEditor(debugPortSpinner, "#"));

    Mnemonics.setLocalizedText(localDebugInfoLabel, NbBundle.getMessage(NodeJsCustomizerPanel.class, "NodeJsCustomizerPanel.localDebugInfoLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(syncCheckBox, NbBundle.getMessage(NodeJsCustomizerPanel.class, "NodeJsCustomizerPanel.syncCheckBox.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addComponent(nodePathPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addGroup(layout.createSequentialGroup()
            .addComponent(defaultNodeRadioButton)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(configureNodeButton))
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(localDebugInfoLabel)
            .addGap(0, 0, Short.MAX_VALUE))
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(enabledCheckBox)
                .addComponent(customNodeRadioButton)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(debugPortLabel)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(debugPortSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addComponent(syncCheckBox))
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(enabledCheckBox)
            .addGap(18, 18, 18)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(defaultNodeRadioButton)
                .addComponent(configureNodeButton))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(customNodeRadioButton)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(nodePathPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(debugPortLabel)
                .addComponent(debugPortSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(localDebugInfoLabel)
            .addGap(18, 18, 18)
            .addComponent(syncCheckBox))
    );
}
 
Example 19
Source File: CherryPickAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NbBundle.Messages({
    "LBL_CherryPickResultProcessor.abortButton.text=&Abort",
    "LBL_CherryPickResultProcessor.abortButton.TTtext=Abort the interrupted process and reset back to the original commit.",
    "LBL_CherryPickResultProcessor.resolveButton.text=&Resolve",
    "LBL_CherryPickResultProcessor.resolveButton.TTtext=Files in conflict will be opened in the Resolve Conflict dialog.",
    "LBL_CherryPickResultProcessor.resolveConflicts=Resolve Conflicts",
    "MSG_CherryPickResultProcessor.resolveConflicts=Cherry-picking produced unresolved conflicts.\n"
        + "You can resolve them manually, review them in the Versioning view\n"
        + "or completely abort the process and reset back to the original state.",
    "LBL_CherryPickResultProcessor.revertButton.text=&Revert",
    "LBL_CherryPickResultProcessor.revertButton.TTtext=Revert local changes to the state in the HEAD and removes unversioned files.",
    "LBL_CherryPickResultProcessor.reviewButton.text=Re&view",
    "LBL_CherryPickResultProcessor.reviewButton.TTtext=Opens the Versioning view and lists the conflicted files.",
    "MSG_CherryPick.resolving=Resolving conflicts..."
})
private CherryPickOperation resolveCherryPickConflicts (Collection<File> conflicts) {
    CherryPickOperation action = null;
    JButton abort = new JButton();
    Mnemonics.setLocalizedText(abort, Bundle.LBL_CherryPickResultProcessor_abortButton_text());
    abort.setToolTipText(Bundle.LBL_CherryPickResultProcessor_abortButton_TTtext());
    JButton resolve = new JButton();
    Mnemonics.setLocalizedText(resolve, Bundle.LBL_CherryPickResultProcessor_resolveButton_text());
    resolve.setToolTipText(Bundle.LBL_CherryPickResultProcessor_resolveButton_TTtext());
    JButton review = new JButton();
    Mnemonics.setLocalizedText(review, Bundle.LBL_CherryPickResultProcessor_reviewButton_text());
    review.setToolTipText(Bundle.LBL_CherryPickResultProcessor_reviewButton_TTtext());
    Object o = DialogDisplayer.getDefault().notify(new NotifyDescriptor(
            Bundle.MSG_CherryPickResultProcessor_resolveConflicts(),
            Bundle.LBL_CherryPickResultProcessor_resolveConflicts(),
            NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE,
            new Object[] { resolve, review, abort, NotifyDescriptor.CANCEL_OPTION }, resolve));
    if (o == review) {
        openInVersioningView(conflicts);
    } else if (o == resolve) {
        GitProgressSupport executor = new ResolveConflictsExecutor(conflicts.toArray(new File[conflicts.size()]));
        executor.start(Git.getInstance().getRequestProcessor(repository), repository, Bundle.MSG_CherryPick_resolving());
    } else if (o == abort) {
        action = CherryPickOperation.ABORT;
    }
    return action;
}
 
Example 20
Source File: CustomizerLibraries.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void librariesBrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_librariesBrowseActionPerformed
        if (!isSharable) {
            if (uiProperties.makeSharable()) {
                isSharable = true;
                sharedLibrariesLabel.setEnabled(true);
                librariesLocation.setEnabled(true);
                librariesLocation.setText(uiProperties.getProject().getAntProjectHelper().getLibrariesLocation());
                Mnemonics.setLocalizedText(librariesBrowse, NbBundle.getMessage(CustomizerLibraries.class, "LBL_CustomizerLibraries_Browse_JButton")); // NOI18N
                updateJars(uiProperties.JAVAC_MODULEPATH_MODEL);
                updateJars(uiProperties.JAVAC_CLASSPATH_MODEL);
                updateJars(uiProperties.JAVAC_PROCESSORMODULEPATH_MODEL);
                updateJars(uiProperties.JAVAC_PROCESSORPATH_MODEL);
                updateJars(uiProperties.JAVAC_TEST_MODULEPATH_MODEL);
                updateJars(uiProperties.JAVAC_TEST_CLASSPATH_MODEL);
                updateJars(uiProperties.RUN_MODULEPATH_MODEL);
                updateJars(uiProperties.RUN_CLASSPATH_MODEL);
                updateJars(uiProperties.RUN_TEST_MODULEPATH_MODEL);
                updateJars(uiProperties.RUN_TEST_CLASSPATH_MODEL);
                updateJars(uiProperties.ENDORSED_CLASSPATH_MODEL);
                switchLibrary();
            }
        } else {
            File prjLoc = FileUtil.toFile(uiProperties.getProject().getProjectDirectory());
            String s[] = splitPath(librariesLocation.getText().trim());
            String loc = SharableLibrariesUtils.browseForLibraryLocation(s[0], this, prjLoc);
            if (loc != null) {
                final String path = s[1] != null ? loc + File.separator + s[1] :
                    loc + File.separator + SharableLibrariesUtils.DEFAULT_LIBRARIES_FILENAME;
                final File base = FileUtil.toFile(uiProperties.getProject().getProjectDirectory());
                final File location = FileUtil.normalizeFile(PropertyUtils.resolveFile(base, path));
                if (location.exists()) {
                    librariesLocation.setText(path);
                    switchLibrary();
                } else {
                    DialogDisplayer.getDefault().notify(
                        new NotifyDescriptor(
                            NbBundle.getMessage(CustomizerLibraries.class, "ERR_InvalidProjectLibrariesFolder"),
                            NbBundle.getMessage(CustomizerLibraries.class, "TITLE_InvalidProjectLibrariesFolder"),
                            NotifyDescriptor.DEFAULT_OPTION,
                            NotifyDescriptor.ERROR_MESSAGE,
                            new Object[] {NotifyDescriptor.OK_OPTION},
                            NotifyDescriptor.OK_OPTION));
                }
            }
        }
}