org.openide.util.NbBundle Java Examples

The following examples show how to use org.openide.util.NbBundle. 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: LocalServerController.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Validate given local server instance, its source root.
 * @param localServer local server to validate.
 * @param type the type for error messages.
 * @param allowNonEmpty <code>true</code> if the folder can exist and can be non empty.
 * @param allowInRoot  <code>true</code> if the folder can exist and can be a root directory "/" (on *NIX only).
 * @return error message or <code>null</code> if source root is ok.
 * @see Utils#validateProjectDirectory(java.lang.String, java.lang.String, boolean)
 */
public static String validateLocalServer(final LocalServer localServer, String type, boolean allowNonEmpty,
        boolean allowInRoot) {
    if (!localServer.isEditable()) {
        return null;
    }
    String err = null;
    String sourcesLocation = localServer.getSrcRoot();
    File sources = FileUtil.normalizeFile(new File(sourcesLocation));
    if (sourcesLocation.trim().length() == 0
            || !Utils.isValidFileName(sources)) {
        err = NbBundle.getMessage(LocalServerController.class, "MSG_Illegal" + type + "Name");
    } else {
        err = Utils.validateProjectDirectory(sourcesLocation, type, allowNonEmpty, allowInRoot);
    }
    return err;
}
 
Example #2
Source File: ClassesListControllerUI.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void hideDiffProgress() {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            w.setVisible(false);
            p.setVisible(false);
            p.setIndeterminate(false);
            
            if (classesListController.isDiff()) {
                l.setText("<html><nobr>" + NbBundle.getMessage(ClassesListControllerUI.class, // NOI18N
                          "ClassesListControllerUI_ShowingDiffText", "<a href='#'>", "</a>") + "</nobr></html>"); // NOI18N
            } else {
                l.setText("<html><nobr><a href='#'>" + Bundle.ClassesListControllerUI_CompareWithAnotherText() + "</a></nobr></html>"); // NOI18N
            }
            l.setVisible(true);
        }
    });
}
 
Example #3
Source File: TagManager.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Component getListCellRendererComponent (JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    if (value instanceof HgTag) {
        HgTag tag = (HgTag) value;
        StringBuilder sb = new StringBuilder().append(tag.getName());
        HgLogMessage.HgRevision parent = parentRevision;
        if (parent != null && parent.getRevisionNumber().equals(tag.getRevisionInfo().getRevisionNumber())) {
            sb.append(MARK_ACTIVE_HEAD);
        }
        if (tag.isLocal()) {
            sb.append(" - ").append(NbBundle.getMessage(TagManager.class, "LBL_TagManager.tag.local")); //NOI18N
        }
        value = sb.toString();
    }
    return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
}
 
Example #4
Source File: ImplementOverridePanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Creates new form ConstructorPanel */
   public ImplementOverridePanel(ElementNode.Description description, boolean isImplement) {
       initComponents();
       elementSelector = new ElementSelectorPanel(description, false, true);
       elementSelector.getExplorerManager().addPropertyChangeListener(new PropertyChangeListener() {
           @Override
           public void propertyChange(PropertyChangeEvent evt) {
               firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
           }
       });
       java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
       gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
       gridBagConstraints.weightx = 1.0;
       gridBagConstraints.weighty = 1.0;
       gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12);
       add(elementSelector, gridBagConstraints);
       selectorLabel.setText(NbBundle.getMessage(ImplementOverrideMethodGenerator.class, isImplement ? "LBL_implement_method_select" : "LBL_override_method_select")); //NOI18N
       selectorLabel.setLabelFor(elementSelector);
       
       elementSelector.doInitialExpansion(isImplement ? -1 : 1);

this.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ImplementOverrideMethodGenerator.class, "A11Y_Generate_ImplementOverride"));
   }
 
Example #5
Source File: ValidateSupport.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Asserts that an attribute has a boolean value.
 * @param   value       Value of attribute.
 * @param   name        Name of attribute.
 * @param   source      Source element.
 * @param   category    Category of failure.
 * @return  <code>true</code> if more validations can be made; <code>false</code> otherwise.
 */
public boolean assertBooleanAttrib(String value, String name, Component source, int category) {
    if ((source instanceof WSDLComponent)
                && !mValConfig.getBooleanProperty(ValidateConfiguration.WSDL_SYNTAX_ATTRIB_BOOLEAN)) {
        return true;
    }
    
    if (!isAttributeAbsent(value) && !(value.equals("yes") || value.equals("no"))) {
        return fireToDo(Validator.ResultType.ERROR,
            source,
            NbBundle.getMessage(ValidateSupport.class, VAL_NOT_BOOLEAN_ATTRIB, name),
            NbBundle.getMessage(ValidateSupport.class, FIX_NOT_BOOLEAN_ATTRIB, name)
        );
    }
    return true;
}
 
Example #6
Source File: FxModelBuilder.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@NbBundle.Messages({
    "#0 - attribute name",
    "ERR_unexpectedScriptAttribute=Unexpected attribute in fx:script: {0}"
})
private FxNode handleFxScript(Attributes atts) {
    String ref = null;
    
    for (int i = 0; i < atts.getLength(); i++) {
        String name = atts.getLocalName(i);
         if (!FX_ATTR_REFERENCE_SOURCE.equals(name)) {
            addAttributeError(atts.getQName(i),
                "invalid-script-attribute",
                ERR_unexpectedScriptAttribute(name),
                name
            );
            continue;
        }
        ref = atts.getValue(i);
    }
    return accessor.createScript(ref);
}
 
Example #7
Source File: BranchSelector.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public BranchSelector (File repository) {
    this.repository = repository;
    panel = new BranchSelectorPanel();
    panel.branchList.setCellRenderer(new RevisionRenderer());
    
    filterTimer = new Timer(300, new ActionListener() {
        @Override
        public void actionPerformed (ActionEvent e) {
            filterTimer.stop();
            applyFilter();
        }
    });
    panel.txtFilter.getDocument().addDocumentListener(this);
    panel.branchList.addListSelectionListener(this);
    panel.jPanel1.setVisible(false);
    cancelButton = new JButton();
    org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_BranchSelector_Action_Cancel")); // NOI18N
    cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSD_BranchSelector_Action_Cancel")); // NOI18N
    cancelButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSN_BranchSelector_Action_Cancel")); // NOI18N
}
 
Example #8
Source File: DefaultDataObject.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Either opens the in text editor or asks user questions.
 */
public void open() {
    EditorCookie ic = getCookie(EditorCookie.class);
    if (ic != null) {
        ic.open();
    } else {
        // ask a query 
        List<Object> options = new ArrayList<Object>();
        options.add (NotifyDescriptor.OK_OPTION);
        options.add (NotifyDescriptor.CANCEL_OPTION);
        NotifyDescriptor nd = new NotifyDescriptor (
            NbBundle.getMessage (DefaultDataObject.class, "MSG_BinaryFileQuestion"),
            NbBundle.getMessage (DefaultDataObject.class, "MSG_BinaryFileWarning"),
            NotifyDescriptor.DEFAULT_OPTION,
            NotifyDescriptor.QUESTION_MESSAGE,
            options.toArray(), null
        );
        Object ret = DialogDisplayer.getDefault().notify (nd);
        if (ret != NotifyDescriptor.OK_OPTION) {
            return;
        }
        
        EditorCookie c = getCookie(EditorCookie.class, true);
        c.open ();
    }
}
 
Example #9
Source File: EarDataNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected Sheet createSheet () {
    Sheet s = new Sheet ();
    Sheet.Set ss = new Sheet.Set ();
    ss.setName (DEPLOYMENT);
    ss.setDisplayName (NbBundle.getMessage (EarDataNode.class, "PROP_deploymentSet"));
    ss.setShortDescription (NbBundle.getMessage (EarDataNode.class, "HINT_deploymentSet"));  
    ss.setValue ("helpID", "TBD---Ludo ejbjar node");   // NOI18N
    
    Node.Property p = new PropertySupport.ReadOnly (
        PROPERTY_DOCUMENT_TYPE,
        String.class,
        NbBundle.getBundle(EarDataNode.class).getString("PROP_documentDTD"),
        NbBundle.getBundle(EarDataNode.class).getString("HINT_documentDTD")
    ) {
        public Object getValue () {
            return dataObject.getApplication().getVersion();
        }
    };
    ss.put (p);
    s.put (ss);
    
    return s;
}
 
Example #10
Source File: ExportConfirmationPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Creates new form ExportConfirmationPanel */
public ExportConfirmationPanel() {
    initComponents();
    Mnemonics.setLocalizedText(cbSkip, NbBundle.getMessage(ExportConfirmationPanel.class, "ExportConfirmationPanel.cbSkip.text"));
    String message = NbBundle.getMessage(ExportConfirmationPanel.class, "ExportConfirmationPanel.lblMessage.text"); // NOI18N
    lblMessage.setText("<html>" + message + "</html>");  //NOI18N
    cbSkip.setSelected(getSkipOption());
}
 
Example #11
Source File: SimpleTestCaseWizardIterator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void loadSettings(WizardDescriptor wizard) {
    JUnitSettings settings = JUnitSettings.getDefault();
    
    wizard.putProperty(GuiUtils.CHK_PUBLIC, settings.isMembersPublic());
    wizard.putProperty(GuiUtils.CHK_PROTECTED, settings.isMembersProtected());
    wizard.putProperty(GuiUtils.CHK_PACKAGE, settings.isMembersPackage());
    wizard.putProperty(GuiUtils.CHK_SETUP, settings.isGenerateSetUp());
    wizard.putProperty(GuiUtils.CHK_TEARDOWN, settings.isGenerateTearDown());
    wizard.putProperty(GuiUtils.CHK_BEFORE_CLASS, settings.isGenerateClassSetUp());
    wizard.putProperty(GuiUtils.CHK_AFTER_CLASS, settings.isGenerateClassTearDown());
    wizard.putProperty(GuiUtils.CHK_METHOD_BODIES, settings.isBodyContent());
    wizard.putProperty(GuiUtils.CHK_JAVADOC, settings.isJavaDoc());
    wizard.putProperty(GuiUtils.CHK_HINTS, settings.isBodyComments());
    wizard.putProperty("NewFileWizard_Title", NbBundle.getMessage(SimpleTestStepLocation.class, "LBL_simpleTestWizard_stepName"));
}
 
Example #12
Source File: HttpMethodsNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public HttpMethodsNode(Project project, RestServicesModel model, 
        String serviceName) {
    super(Children.create( new HttpMethodsChildren(project, model, 
            serviceName), true));
    setDisplayName(NbBundle.getBundle(HttpMethodsNode.class).
            getString("LBL_HttpMethods"));          // NOI18N
    
}
 
Example #13
Source File: GuiUtils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a specified set of checkboxes.
 * The checkboxes are specified by unique identifiers.
 * The identifiers are given by this class's constants <code>CHK_xxx</code>.
 * <p>
 * The array of strings passed as the argument may also contain
 * <code>null</code> items. In such a case, the resulting array
 * of check-boxes will contain <code>null</code>s on the corresponding
 * possitions.
 *
 * @param  ids  identifiers of the checkboxes to be created
 * @return  array of checkboxes corresponding to the array of identifiers
 *          passed as the argument
 */
public static JCheckBox[] createCheckBoxes(String[] ids) {
    JCheckBox[] chkBoxes = new JCheckBox[ids.length];
    
    if (chkBoxes.length == 0) {
        return chkBoxes;
    }
    
    ResourceBundle bundle = NbBundle.getBundle(GuiUtils.class);
    for (int i = 0; i < ids.length; i++) {
        String id = ids[i];
        
        if (id == null) {
            chkBoxes[i] = null;
            continue;
        }
        
        JCheckBox chkBox = new JCheckBox();
        String baseName = "CommonTestsCfgOfCreate.chk" + id;              //NOI18N
        AccessibleContext accessCtx = chkBox.getAccessibleContext();
        Mnemonics.setLocalizedText(
                chkBox,
                bundle.getString(baseName + ".text"));              //NOI18N
        chkBox.setToolTipText(
                bundle.getString(baseName + ".toolTip"));           //NOI18N
        accessCtx.setAccessibleName(
                bundle.getString(baseName + ".AN"));                //NOI18N
        accessCtx.setAccessibleDescription(
                bundle.getString(baseName + ".AD"));                //NOI18N
        
        chkBoxes[i] = chkBox;
    }
    return chkBoxes;
}
 
Example #14
Source File: ComposerOptionsValidator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages("ComposerOptionsValidator.warning.invalidAuthorEmail=Author e-mail is not valid.")
ComposerOptionsValidator validateAuthorEmail(String authorEmail) {
    if (!StringUtils.hasText(authorEmail)
            || !EMAIL_REGEX.matcher(authorEmail).matches()) {
        result.addWarning(new ValidationResult.Message("authorEmail", Bundle.ComposerOptionsValidator_warning_invalidAuthorEmail())); // NOI18N
    }
    return this;
}
 
Example #15
Source File: ReturnTypeHintError.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "ReturnTypeHintErrorInvalidVoidDesc=\"void\" cannot be used with \"?\""
})
private void checkInvalidVoidReturnType(Expression returnType, String name, List<Hint> hints) {
    if (Type.VOID.equals(name)) {
        addHint(returnType, Bundle.ReturnTypeHintErrorInvalidVoidDesc(), hints);
    }
}
 
Example #16
Source File: CustomizerRun.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public CustomizerRun(EarProjectProperties earProperties) {
    this.uiProperties = earProperties;
    initComponents();
    this.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(CustomizerRun.class, "ACS_CustomizeRun_A11YDesc")); // NOI18N
    clientModuleUriCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateEnabled();
        }
    });
    initValues();
    updateEnabled();
}
 
Example #17
Source File: IntEditor.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void doSetAsText(String s) {
    //fixes issue 23077, confusing error message from NFE.
    //IllegalArgumentException is a more correct exception to throw
    //anyway
    try {
        setValue(Integer.valueOf(s));
    } catch (NumberFormatException nfe) {
        String msg = NbBundle.getMessage(
            IntEditor.class, "EXC_ILLEGAL_VALUE_TEXT") + s; //NOI18N
        RuntimeException iae = new IllegalArgumentException(msg); //NOI18N
        UIExceptions.annotateUser(iae, msg, msg, nfe, new java.util.Date());
        throw iae;
    }
}
 
Example #18
Source File: RelativeOrderingPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private String getOrderItemFromUser(String value) {
    OrderingItemPanel p = new OrderingItemPanel(value);
    DialogDescriptor dd = new DialogDescriptor(p,
            NbBundle.getMessage(RelativeOrderingPanel.class, "TTL_Ordering"));
    dd.createNotificationLineSupport();
    p.setDlgSupport(dd);
    dd.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);
    if (NotifyDescriptor.OK_OPTION.equals(DialogDisplayer.getDefault().notify(dd))) {
        return p.getResult();
    }
    return null;
}
 
Example #19
Source File: OperationWidget.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public TabImageWidget(Scene scene, int size) {
    super(scene, Color.LIGHT_GRAY, size, size);
    setBorder(BorderFactory.createLineBorder(0, Color.LIGHT_GRAY));
    setBackground(Color.WHITE);
    setOpaque(true);
    setToolTipText(NbBundle.getMessage(OperationWidget.class, "Hint_TabbedView"));
}
 
Example #20
Source File: CallWsOperationGenerator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void invoke() {
    InvokeOperationCookie.ClientSelectionPanel innerPanel = invokeOperationCookie.getDialogDescriptorPanel();
    final DialogDescriptor descriptor = new DialogDescriptor(innerPanel,
            NbBundle.getMessage(CallWsOperationGenerator.class, "TTL_SelectOperation"));
    descriptor.setValid(false);
    innerPanel.addPropertyChangeListener(
            InvokeOperationCookie.ClientSelectionPanel.PROPERTY_SELECTION_VALID,
            new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent evt) {
                    descriptor.setValid(((Boolean)evt.getNewValue()));
                }

            });
    DialogDisplayer.getDefault().notify(descriptor);
    if (DialogDescriptor.OK_OPTION.equals(descriptor.getValue())) {
        Lookup selectedClient = innerPanel.getSelectedClient();
        invokeOperationCookie.invokeOperation(selectedClient, targetComponent);

        // logging usage of action
        Object[] params = new Object[2];
        String cookieClassName = invokeOperationCookie.getClass().getName();
        if (cookieClassName.contains("jaxrpc")) { // NOI18N
            params[0] = LogUtils.WS_STACK_JAXRPC;
        } else {
            params[0] = LogUtils.WS_STACK_JAXWS;
        }
        params[1] = "CALL WS OPERATION"; // NOI18N
        LogUtils.logWsAction(params);
    }
}
 
Example #21
Source File: SelectorPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Creates new form SelectorPanel */
public SelectorPanel(SelectorPanel.Panel firer) {
    this.firer = firer;
    initComponents();
    postInitComponents ();
    this.setName (NbBundle.getMessage(SelectorPanel.class,"TXT_SelectPlatformTypeTitle"));
    this.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SelectorPanel.class,"AD_SelectPlatformType"));
}
 
Example #22
Source File: GestureSubmitter.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static void log(String type, List<String> params) {
    LogRecord record = new LogRecord(Level.INFO, type);
    record.setResourceBundle(NbBundle.getBundle(GestureSubmitter.class));
    record.setResourceBundleName(GestureSubmitter.class.getPackage().getName() + ".Bundle"); // NOI18N
    record.setLoggerName(USG_LOGGER.getName());

    record.setParameters(params.toArray(new Object[params.size()]));

    USG_LOGGER.log(record);
}
 
Example #23
Source File: SymfonyOptionsValidator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages("SymfonyOptionsValidator.installer=Installer")
public SymfonyOptionsValidator validateInstaller(String installer) {
    String warning = PhpExecutableValidator.validateCommand(installer, Bundle.SymfonyOptionsValidator_installer());
    if (warning != null) {
        result.addWarning(new ValidationResult.Message(SymfonyOptions.INSTALLER, warning));
    }
    return this;
}
 
Example #24
Source File: CustomizerRun.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private boolean createNewConfiguration(boolean platformChanged) {
    DialogDescriptor d = new DialogDescriptor(new CreateConfigurationPanel(platformChanged), NbBundle.getMessage(CustomizerRun.class, "CustomizerRun.input.title"));        
    
    if (DialogDisplayer.getDefault().notify(d) != NotifyDescriptor.OK_OPTION) {
        return false;
    }
    String name = ((CreateConfigurationPanel) d.getMessage()).getConfigName();
    String config = name.replaceAll("[^a-zA-Z0-9_.-]", "_"); // NOI18N
    if (config.trim().length() == 0) {
        //#143764
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
                NbBundle.getMessage(CustomizerRun.class, "CustomizerRun.input.empty", config), // NOI18N
                NotifyDescriptor.WARNING_MESSAGE));
        return false;

    }
    if (configs.get(config) != null) {
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
                NbBundle.getMessage(CustomizerRun.class, "CustomizerRun.input.duplicate", config), // NOI18N
                NotifyDescriptor.WARNING_MESSAGE));
        return false;
    }
    Map<String,String> m = new HashMap<String,String>();
    if (!name.equals(config)) {
        m.put("$label", name); // NOI18N
    }
    configs.put(config, m);
    configChanged(config);
    uiProperties.activeConfig = config;
    return true;
}
 
Example #25
Source File: MetaDataCustomizer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public String getColumnName(int column) {
    if (column == KEY_COLUMN) {
        return org.openide.util.NbBundle.getMessage(MetaDataCustomizer.class, "LBL_NAME_COLUMN");
    } else if (column == VALUE_COLUMN) {
        return org.openide.util.NbBundle.getMessage(MetaDataCustomizer.class, "LBL_VALUE_COLUMN");
    }
    return "";
}
 
Example #26
Source File: PropertiesEditorSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** 
 * Overrides superclass abstract method.
 * Is modified and is being closed.
 * @return text to show to the user
 */
protected String messageSave () {
    return NbBundle.getMessage (
        PropertiesEditorSupport.class,
        "MSG_SaveFile", // NOI18N
        getFileLabel()
    );
}
 
Example #27
Source File: TracerView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages("LBL_SelectingIntervals=Selecting method intervals...")
@Override
public void actionPerformed(ActionEvent actionEvent) {
    RequestProcessor.getDefault().post(new Runnable() {
        public void run() {
            ProgressHandle pHandle = null;
            try {
                pHandle = ProgressHandle.createHandle(Bundle.LBL_SelectingIntervals());
                pHandle.setInitialDelay(0);
                pHandle.start();
                
                List<Integer> ints = model.getIntervals(node);
                assert ints.size() % 2 == 0;
                final Iterator<Integer> iter = ints.iterator();
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        TimelineSupport support = model.getTimelineSupport();
                        support.resetSelectedIntervals();
                        while (iter.hasNext()) {
                            int start = iter.next();
                            int stop  = iter.next();
                            support.selectInterval(start, stop);
                        }
                        support.selectedIntervalsChanged();
                    }
                });
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            } finally {
                if (pHandle != null) pHandle.finish();
            }
        }
    });
}
 
Example #28
Source File: JPQLEditorPanel.java    From jeddict with Apache License 2.0 5 votes vote down vote up
private void initCustomComponents() {
    initComponents();
    save_Button = new javax.swing.JButton();
    save_Button.setIcon(new ImageIcon(SaveAction.class.getClassLoader().getResource("org/openide/resources/actions/save.png"))); // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(save_Button, org.openide.util.NbBundle.getMessage(JPQLEditorPanel.class, "JPQLEditorPanel.save_Button.text")); // NOI18N
    save_Button.addActionListener(this::save_ButtonActionPerformed);

    toolBar.add(save_Button, 0);
    toolBar.add(new JToolBar.Separator(new Dimension(200, 10)),1);
    
    setFocusToEditor();
    requestProcessor = new RequestProcessor("jpql-parser", 1, true);
}
 
Example #29
Source File: FlashingIcon.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private String getToolTip(int unread, NotificationImpl n) {
    if (unread < 1) {
        return null;
    }
    String tooltip = "<b>" + NbBundle.getMessage(FlashingIcon.class, unread == 1 ? "LBL_UnreadNotification" : "LBL_UnreadNotifications", unread) + "</b>";
    if (n != null) {
        tooltip += "<br>" + NbBundle.getMessage(FlashingIcon.class,"LBL_LastNotification") + " " + n.getTitle();
    }
    tooltip = "<html>" + tooltip + "</html>";

    return tooltip;
}
 
Example #30
Source File: JFXRunPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void comboBoxWebBrowserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBoxWebBrowserActionPerformed
    if(!comboBoxWebBrowserActionRunning) {
        comboBoxWebBrowserActionRunning = true;
        String config = getSelectedConfig();
        String sel = (String)comboBoxWebBrowser.getSelectedItem();
        if(JFXProjectProperties.isEqualIgnoreCase(sel, NbBundle.getMessage(JFXRunPanel.class, "MSG_NoBrowser"))) { //NOI18N
            configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER, JFXProjectProperties.RUN_IN_BROWSER_UNDEFINED);
            configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER_PATH, JFXProjectProperties.RUN_IN_BROWSER_UNDEFINED);
            if(radioButtonBE.isSelected()) {
                radioButtonSA.setSelected(true);
                runTypeChanged(JFXProjectProperties.RunAsType.STANDALONE);
            }
            radioButtonBE.setEnabled(false);
        } else {
            configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER, sel);
            configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER_PATH, jfxProps.getBrowserPaths().get(sel));
            if (Utilities.isMac()) {
                String browserArgs = jfxProps.getBrowserPaths().get(sel + "-args"); //NOI18N
                configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER_ARGUMENTS, browserArgs);
            } else {
                configs.setPropertyTransparent(config, JFXProjectProperties.RUN_IN_BROWSER_ARGUMENTS, null);
            }
            if(!radioButtonBE.isEnabled()) {
                radioButtonBE.setEnabled(true);
            }
        }
        setEmphasizedFont(labelWebBrowser, config != null && !JFXProjectProperties.isEqualText(sel, configs.getDefaultProperty(JFXProjectProperties.RUN_IN_BROWSER)));
        comboBoxWebBrowserActionRunning = false;
    }
}