org.openide.util.NbBundle.Messages Java Examples

The following examples show how to use org.openide.util.NbBundle.Messages. 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: ExtraPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("LBL_InstallerPanel=Installer")
@Override
    public Category createCategory(Lookup context) {
    Project project = context.lookup(Project.class);
    NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
    if (watcher!=null &&
            NbMavenProject.TYPE_NBM_APPLICATION.equalsIgnoreCase(watcher.getPackagingType())) {
        String version = PluginPropertyUtils.getPluginVersion(watcher.getMavenProject(), "org.codehaus.mojo", "nbm-maven-plugin");
        if (version == null || new ComparableVersion(version).compareTo(new ComparableVersion("3.7-SNAPSHOT")) >= 0) {
            return null; // now handled by maven.apisupport
        }
        return ProjectCustomizer.Category.create(
                "Installer",
                LBL_InstallerPanel(),
                null,
                (ProjectCustomizer.Category[])null);
    }
    return null;
}
 
Example #2
Source File: LibrariesCustomizer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("LibrariesCustomizer.customizeLibrary.title=Customize Library")
private static boolean customizeLibrary(org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer,
        LibraryImplementation activeLibrary) {
    customizer.hideLibrariesList();
    customizer.setBorder(new EmptyBorder(12, 8, 0, 10));
    customizer.setSelectedLibrary (activeLibrary);
    DialogDescriptor descriptor = new DialogDescriptor(customizer, LibrariesCustomizer_customizeLibrary_title());
    Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);
    setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription());
    try {
        dlg.setVisible(true);
        if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {
            customizer.apply();
            return true;
        } else {
            return false;
        }
    } finally {
        dlg.dispose();
    }
}
 
Example #3
Source File: TrustProjectPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "# {0} = Project name",
    "TrustProjectPanel.INFO=<html><p>NetBeans is about to invoke a Gradle build process of the project: <b>{0}</b>.</p>"
        + " <p>Executing Gradle can be potentially un-safe as it"
        + " allows arbitrary code execution.</p>",
    "TrustProjectPanel.INFO_UNKNOWN=<html><p>NetBeans is about to invoke a Gradle build process.</p>"
        + " <p>Executing Gradle can be potentially un-safe as it"
        + " allows arbitrary code execution.</p>"
})
public TrustProjectPanel(Project project) {
    initComponents();
    ProjectInformation info = project != null ? project.getLookup().lookup(ProjectInformation.class) : null;
    if (project == null) {
        cbTrustProject.setEnabled(false);
        cbTrustProject.setVisible(false);
    }
    if (info == null) {
        lbTrustMessage.setText(Bundle.TrustProjectPanel_INFO_UNKNOWN());
    } else {
        lbTrustMessage.setText(Bundle.TrustProjectPanel_INFO(info.getDisplayName()));
    }
}
 
Example #4
Source File: IDENativeMavenWizardIterator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages("LBL_CreateProjectStep2=Name and Location")
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    if (titlename != null) {
        wiz.putProperty ("NewProjectWizard_Title", titlename); // NOI18N        
    }
    index = 0;
    ValidationGroup vg = ValidationGroup.create(new WizardDescriptorAdapter(wiz));
    panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
    List<String> steps = new ArrayList<String>();
    
    panels.add(new BasicWizardPanel(vg, null, true, false, null)); //only download archetype (for additional props) when unknown archetype is used.
    steps.add(LBL_CreateProjectStep2());
    for (int i = 0; i < panels.size(); i++) {
        JComponent c = (JComponent) panels.get(i).getComponent();
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps.toArray(new String[0]));
  }
    
}
 
Example #5
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.closeSubprojects", category = "Project")
@ActionRegistration(displayName = "#ACT_CloseRequired", lazy=false)
@ActionReference(position = 2000, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_CloseRequired=Close Required Projects")
public static ContextAwareAction closeSubprojectsAction() {
    return new ConditionallyShownAction() {
        protected @Override Action forProject(Project p, FileObject fo) {
            NbMavenProjectImpl project = p.getLookup().lookup(NbMavenProjectImpl.class);
            if (project != null && NbMavenProject.TYPE_POM.equalsIgnoreCase(project.getProjectWatcher().getPackagingType())) {
                return new CloseSubprojectsAction(project);
            } else {
                return null;
            }
        }
    };
}
 
Example #6
Source File: GroupEditPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("WARN_GroupExists=Another group with the same name exists.")
protected boolean doCheckExistingGroups(JTextField field, Group actualGroup) {
    getCategory().setErrorMessage(null);
    getCategory().setValid(true);
    String name = field.getText();
            
    if (name != null) {
        if (name.trim().length() <= 0 || name.trim().length() >= MAX_NAME) {
            return false;
        }
        Set<Group> otherGroups = Group.allGroups();
        otherGroups.remove(actualGroup);
        if (name.equalsIgnoreCase(NONE_GOUP)) {
            getCategory().setErrorMessage(WARN_GroupExists());
            return false;
        }
        for (Group group : otherGroups) {
            if (name.equalsIgnoreCase(group.getName())) {
                getCategory().setErrorMessage(WARN_GroupExists());
                return false;
            }
        }
    }
    return true;
}
 
Example #7
Source File: OpenBrandingEditorAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages("OpenBrandingEditorAction_Error_NoApplication=We could not find the application project that is associated with this branding project.\nPlease open it and retry.")
public void actionPerformed(ActionEvent e) {
    RP.post(new Runnable() {
        @Override public void run() {
            final Project project = context.lookup(Project.class);
            final MavenProject mavenProject = project.getLookup().lookup(NbMavenProject.class).getMavenProject();
            final BrandingModel model = createBrandingModel(project, brandingPath(project));
            final boolean hasAppProject = MavenNbModuleImpl.findAppProject(project) != null;
            final boolean hasExternalPlatform = MavenNbModuleImpl.findIDEInstallation(project) != null;
            
            EventQueue.invokeLater(new Runnable() {
                @Override public void run() {
                    if (!hasAppProject && !hasExternalPlatform) {
                        //TODO do we need the external platform check? MavenPLatfomrJarProvider has it, but it's more generic than branding
                        NotifyDescriptor.Message message  = new NotifyDescriptor.Message(OpenBrandingEditorAction_Error_NoApplication(), NotifyDescriptor.ERROR_MESSAGE);
                        DialogDisplayer.getDefault().notify(message);
                        return;
                    }
                    BrandingUtils.openBrandingEditor(mavenProject.getName(), project, model);
                }
            });
        }
    });
}
 
Example #8
Source File: CustomizerLibraries.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("MSG_PublicPackagesAddedFmt=Exported {0} public package(s).\nList of public packages can be further customized on \"API Versioning\" tab.")
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
    int[] selectedIndices = emListComp.getSelectedIndices();
    List<File> jars = new ArrayList<File>();
    DefaultListModel listModel = getProperties().getWrappedJarsListModel();
    for (int i : selectedIndices) {
        Item item = (Item) listModel.getElementAt(i);
        if (item.getType() == Item.TYPE_JAR) {
            jars.add(item.getResolvedFile());
        }
    }
    if (jars.size() > 0) {
        int dif = getProperties().exportPackagesFromJars(jars);
        NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
                MSG_PublicPackagesAddedFmt(dif));
        DialogDisplayer.getDefault().notify(msg);
        for (File jar : jars) {
            isJarExportedMap.put(jar, Boolean.TRUE);
        }
    }
    exportButton.setEnabled(false);
}
 
Example #9
Source File: CopyPathToClipboardAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the clipboard context in textual-format.
 *
 * @param content
 */
@Messages({
    "# {0} - copied file path",
    "CTL_Status_CopyToClipboardSingle=Copy to Clipboard: {0}",
    "# {0} - number of copied paths",
    "CTL_Status_CopyToClipboardMulti={0} paths were copied to clipboard"
})
private void setClipboardContents(String content, int items) {
    Clipboard clipboard = Lookup.getDefault().lookup(ExClipboard.class);
    if (clipboard == null) {
        clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    }
    if (clipboard != null) {
        String statusText = items > 1
                ? Bundle.CTL_Status_CopyToClipboardMulti(items)
                : Bundle.CTL_Status_CopyToClipboardSingle(content);
        StatusDisplayer.getDefault().setStatusText(statusText);
        clipboard.setContents(new StringSelection(content), null);
    }
}
 
Example #10
Source File: SuiteCustomizerBasicBranding.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "ERR_EmptyName=Application name cannot be empty",
    "ERR_InvalidName=Application name is not valid"
})
protected void checkValidity() {
    boolean panelValid = true;
    
    if (panelValid && nameValue.getText().trim().length() == 0) {
        category.setErrorMessage(ERR_EmptyName());//NOI18N
        panelValid = false;
    }

    if (panelValid && !nameValue.getText().trim().matches("[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*")) {//NOI18N
        category.setErrorMessage(ERR_InvalidName());//NOI18N
        panelValid = false;
    }
    
    if (panelValid) {        
        category.setErrorMessage(null);
    }
    category.setValid(panelValid);
}
 
Example #11
Source File: CompileOptionsPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "# {0} - the name of the setting property",
    "COMPILE_DISABLED_HINT=<html>This option is currently specificly controlled"
    + " through your Gradle project (most likely through "
    + "<b>gradle.properties</b>) by <br/> <b>netbeans.{0}</b> property."
})
private void setupCheckBox(JCheckBox check, String property, boolean defaultValue) {
    GradleBaseProject gbp = project != null ? GradleBaseProject.get(project) : null;
    if (gbp != null) {
        if (gbp.getNetBeansProperty(property) != null) {
            check.setEnabled(false);
            check.setSelected(Boolean.parseBoolean(gbp.getNetBeansProperty(property)));
            check.setToolTipText(Bundle.COMPILE_DISABLED_HINT(property));
        } else {
            Preferences prefs = NbGradleProject.getPreferences(project, false);
            check.setSelected(prefs.getBoolean(property, defaultValue));
        }
    }
}
 
Example #12
Source File: SiteDocsNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages("LBL_Site_Pages=Project Site")
public String getDisplayName() {
    if (isTopLevelNode) {
        String s = LBL_Site_Pages();
        DataObject dob = getOriginal().getLookup().lookup(DataObject.class);
        FileObject file = dob.getPrimaryFile();
        try {
            s = file.getFileSystem().getDecorator().annotateName(s, Collections.singleton(file));
        } catch (FileStateInvalidException e) {
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
        }
        
        return s;
    }
    return getOriginal().getDisplayName();
    
}
 
Example #13
Source File: POMModelVisitor.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages({"TOOLTIP_IS_DEFINED=Is Defined?", "TOOLTIP_YES=Yes", "TOOLTIP_NO=No"})
public String getShortDescription() {
    Object[] values = getLookup().lookup(POMCutHolder.class).getCutValues();
    POMModel[] mdls = getLookup().lookup(POMCutHolder.class).getSource();
    StringBuilder buff = new StringBuilder();
    int index = 0;
    buff.append("<html>").
            append(TOOLTIP_Defined_in()).append("<p><table><thead><tr><th>").
            append(TOOLTIP_ArtifactId()).append("</th><th>").
            append(TOOLTIP_IS_DEFINED()).append("</th></tr></thead><tbody>"); //NOI18N
    for (POMModel mdl : mdls) {
        String artifact = mdl.getProject().getArtifactId();
        buff.append("<tr><td>"); //NOI18N
        buff.append(artifact != null ? artifact : "project");
        buff.append("</td><td>"); //NOI18N
        buff.append(values[index] != null ? TOOLTIP_YES() : TOOLTIP_NO());
        buff.append("</td></tr>");//NOI18N
        index++;
    }
    buff.append("</tbody></table>");//NOI18N

    return buff.toString();
}
 
Example #14
Source File: ModuleActions.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "TITLE_javadoc_disabled=No Public Packages",
    "ERR_javadoc_disabled=<html>Javadoc cannot be produced for this module.<br>It is not yet configured to export any packages to other modules.",
    "LBL_configure_pubpkg=Configure Public Packages..."
})
private void promptForPublicPackagesToDocument() {
    // #61372: warn the user, rather than disabling the action.
    if (ApisupportAntUIUtils.showAcceptCancelDialog(
            TITLE_javadoc_disabled(),
            ERR_javadoc_disabled(),
            LBL_configure_pubpkg(),
            null,
            NotifyDescriptor.WARNING_MESSAGE)) {
        CustomizerProviderImpl cpi = project.getLookup().lookup(CustomizerProviderImpl.class);
        cpi.showCustomizer(CustomizerProviderImpl.CATEGORY_VERSIONING, CustomizerProviderImpl.SUBCATEGORY_VERSIONING_PUBLIC_PACKAGES);
    }
}
 
Example #15
Source File: Selenium2Support.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages({"# {0} - template file","MSG_template_not_found=Template file {0} was not found. Check the Selenium 2.0 templates in the Template manager."})
private static void noTemplateMessage(String temp) {
    String msg = Bundle.MSG_template_not_found(temp);     //NOI18N
    NotifyDescriptor descr = new NotifyDescriptor.Message(
            msg,
            NotifyDescriptor.ERROR_MESSAGE);
    DialogDisplayer.getDefault().notify(descr);
}
 
Example #16
Source File: ProjectXMLManager.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Checks if <code>candidates</code> dependencies introduce dependency cycle.
 * In such case returns localized message about which dependency causes the cycle.
 * @param candidates Module dependencies about to be added. May be empty but not <code>null</code>.
 * @return Localized warning message about introduced dependency cycle,
 * <code>null</code> otherwise.
 */
@Messages({"# {0} - candidate project name", "# {1} - this project name", "MSG_cyclic_dep=Adding project {0} as dependency to {1} would introduce cyclic dependency! Dependency was not added."})
public String getDependencyCycleWarning(final Set<ModuleDependency> candidates) {
    for (ModuleDependency md : candidates) {
        File srcLoc = md.getModuleEntry().getSourceLocation();
        if (srcLoc == null) {
            continue;
        }
        FileObject srcLocFO = FileUtil.toFileObject(srcLoc);
        if (srcLocFO == null) {
            continue;
        }
        Project candidate;
        try {
            candidate = ProjectManager.getDefault().findProject(srcLocFO);
        } catch (IOException x) {
            continue;
        }
        if (candidate == null) {
            continue;
        }
        boolean cyclicDep = ProjectUtils.hasSubprojectCycles(project, candidate);
        if (cyclicDep) {
            if (ProjectUtils.hasSubprojectCycles(project, null)) {
                LOG.log(Level.WARNING, "Starting out with subproject cycles in {0} before even changing them", project);
                return null;
            } else {
                String c = ProjectUtils.getInformation(candidate).getDisplayName();
                String m = ProjectUtils.getInformation(project).getDisplayName();
                return MSG_cyclic_dep(c, m);
            }
        }
    }
    return null;
}
 
Example #17
Source File: REPLAction2.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "ERR_CannotBuildProject=Could not build the project",
    "ERR_ProjectBuildFailed=Project build failed, please check Output window",
})
@Override
public void perform(Project project) {
    ActionProvider p = project.getLookup().lookup(ActionProvider.class);
    // check whether the is CoS enabled fo the project
    if (ShellProjectUtils.isCompileOnSave(project)) {
        doRunShell(project);
        return;
    }
    if (p == null || !p.isActionEnabled(ActionProvider.COMMAND_BUILD, Lookups.singleton(project))) {
        StatusDisplayer.getDefault().setStatusText(Bundle.ERR_CannotBuildProject());
        return;
    }
    p.invokeAction(ActionProvider.COMMAND_BUILD, Lookups.fixed(project, new ActionProgress() {
        @Override
        protected void started() {
            // no op
        }

        @Override
        public void finished(boolean success) {
            if (success) {
                doRunShell(project);
            } else {
                StatusDisplayer.getDefault().setStatusText(Bundle.ERR_ProjectBuildFailed());
            }
        }
    }));
}
 
Example #18
Source File: IniDataObject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("Source=&Source")
@MultiViewElement.Registration(
        displayName="#Source",
        iconBase="org/netbeans/modules/languages/ini/resources/ini_file_16.png",
        persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
        mimeType=IniLanguageConfig.MIME_TYPE,
        preferredID="ini.source",
        position=1
)
public static MultiViewEditorElement createMultiViewEditorElement(Lookup context) {
    return new MultiViewEditorElement(context);
}
 
Example #19
Source File: JavaHintLocationPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("ERR_NoClassName=Must specify a class name")
private void updateData() {
    storeToDataModel();
    createdFilesValue.setText(WizardUtils.generateTextAreaContent(
            data.getCreatedModifiedFiles().getCreatedPaths()));
    modifiedFilesValue.setText(WizardUtils.generateTextAreaContent(
            data.getCreatedModifiedFiles().getModifiedPaths()));
    
    if (data.getClassName().isEmpty()) {
        setError(Bundle.ERR_NoClassName());
    } else {
        markValid();
    }
}
 
Example #20
Source File: ActionMappingsPanelProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages("TIT_Action_Mappings=Actions")
public Category createCategory(Lookup context) {
    return ProjectCustomizer.Category.create(
            ModelHandle2.PANEL_MAPPING, 
            TIT_Action_Mappings(), 
            null);
}
 
Example #21
Source File: MoveFileRefactoringUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages("LBL_MoveClassNamed=Move class {0}")
public CustomRefactoringPanel getPanel(ChangeListener parent) {
    if (panel == null) {
        final String packageName = IdentifiersUtil.getPackageName(fo);
        final String sourceName = fo.getName();

        panel = new MoveClassPanel(packageName, LBL_MoveClassNamed(sourceName), fo);
    }
    return panel;
}
 
Example #22
Source File: LicenseHeaderPanelProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages("TIT_Headers=License Headers")
public Category createCategory(Lookup context) {
    return ProjectCustomizer.Category.create(
            ModelHandle2.PANEL_HEADERS,
            TIT_Headers(),
            null);
}
 
Example #23
Source File: SQLCloneableEditor.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages({
     "MSG_SaveModified=File {0} is modified. Save?"
 })
 @Override
 public CloseOperationState canCloseElement() {
     if (sqlEditorSupport().isConsole()) {
         return CloseOperationState.STATE_OK;
     } else {
         DataObject sqlDO = sqlEditorSupport().getDataObject();
         FileObject sqlFO = sqlEditorSupport().getDataObject().getPrimaryFile();
         if (sqlDO.isModified()) {
             if (sqlFO.canWrite()) {
                 Savable sav = sqlDO.getLookup().lookup(Savable.class);
                 if (sav != null) {
                     AbstractAction save = new AbstractAction() {
                         @Override
                         public void actionPerformed(ActionEvent e) {
                             try {
                                 sqlEditorSupport().saveDocument();
                             } catch (IOException ex) {
                                 Exceptions.printStackTrace(ex);
                             }
                         }
                     };
                     save.putValue(Action.LONG_DESCRIPTION, Bundle.MSG_SaveModified(sqlFO.getNameExt()));
                     return MultiViewFactory.createUnsafeCloseState("editor", save, null);
                 }
             }
         }
     }
     return CloseOperationState.STATE_OK;
}
 
Example #24
Source File: ActionMappings.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages("TIT_PLUGIN_EXPRESSION=Add Plugin Expression Property")
public void actionPerformed(ActionEvent e) {
    GoalsProvider provider = Lookup.getDefault().lookup(GoalsProvider.class);
    if (provider != null) {
        AddPropertyDialog panel = new AddPropertyDialog(project, goals.getText());
        DialogDescriptor dd = new DialogDescriptor(panel, TIT_PLUGIN_EXPRESSION());
        dd.setOptions(new Object[] {panel.getOkButton(), DialogDescriptor.CANCEL_OPTION});
        dd.setClosingOptions(new Object[] {panel.getOkButton(), DialogDescriptor.CANCEL_OPTION});
        DialogDisplayer.getDefault().notify(dd);
        if (dd.getValue() == panel.getOkButton()) {
            String expr = panel.getSelectedExpression();
            if (expr != null) {
                String props = area.getText();
                String sep = "\n";//NOI18N
                if (props.endsWith("\n") || props.trim().length() == 0) {//NOI18N
                    sep = "";//NOI18N
                }
                props = props + sep + expr + "="; //NOI18N
                area.setText(props);
                area.setSelectionStart(props.length() - (expr + "=").length()); //NOI18N
                area.setSelectionEnd(props.length());
                area.requestFocusInWindow();
            }
        }
    }
}
 
Example #25
Source File: Ifs.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Hint(displayName="#DN_ToOrIf", description="#DESC_ToOrIf", category="suggestions", hintKind=Hint.Kind.ACTION)
@TriggerPattern("if ($cond1) $then; else if ($cond2) $then; else $else$;")
@Messages({"ERR_ToOrIf=",
           "FIX_ToOrIf=Join ifs using ||"})
public static ErrorDescription toOrIf(HintContext ctx) {
    SourcePositions sp = ctx.getInfo().getTrees().getSourcePositions();
    CompilationUnitTree cut = ctx.getInfo().getCompilationUnit();
    boolean caretAccepted = ctx.getCaretLocation() <= sp.getStartPosition(cut, ctx.getPath().getLeaf()) + 2 || caretInsideToLevelElseKeyword(ctx);
    if (!caretAccepted) return null;
    return ErrorDescriptionFactory.forSpan(ctx, ctx.getCaretLocation(), ctx.getCaretLocation(), Bundle.ERR_ToOrIf(), JavaFixUtilities.rewriteFix(ctx, Bundle.FIX_ToOrIf(), ctx.getPath(), "if ($cond1 || $cond2) $then; else $else$;"));
}
 
Example #26
Source File: IntroduceSuggestion.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages({
    "# {0} - Constant name",
    "# {1} - Type kind",
    "# {2} - Type name",
    "# {3} - File name",
    "IntroduceHintClassConstDesc=Create Constant \"{0}\" in {1} \"{2}\" ({3})"
})
public String getDescription() {
    String typeName = type.getName();
    FileObject fileObject = type.getFileObject();
    String fileName = fileObject == null ? UNKNOWN_FILE_NAME : fileObject.getNameExt();
    String typeKindName = getTypeKindName(type);
    return Bundle.IntroduceHintClassConstDesc(constantName, typeKindName, typeName, fileName);
}
 
Example #27
Source File: J2eeActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.j2ee.verify", category = "Project")
@ActionRegistration(displayName = "#ACT_Verify", lazy=false)
@ActionReference(position = 651, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_Verify=Verify")
public static ContextAwareAction verifyAction() {
    return new VerifyAction();
}
 
Example #28
Source File: SearchClassDependencyInRepo.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@Messages({
    "# {0} - maven coordinates",
    "LBL_Class_Search_Fix=Add Maven Dependency # {0}"})
public String getText() {
    return LBL_Class_Search_Fix(nbvi.getGroupId() + " : " + nbvi.getArtifactId() + " : " + nbvi.getVersion());

}
 
Example #29
Source File: ProblemNotification.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages({
    "# {0} - job name",
    "# {1} - server name",
    "ProblemNotification.ignore.question=Do you wish to cease to receive notifications of failures in {0}? If you change your mind, use Services > Hudson Builders > {1} > {0} > Properties > Watched.",
    "# {0} - job name",
    "ProblemNotification.ignore.title=Ignore Failures in {0}"
})
void ignore() { // #161601
    if (DialogDisplayer.getDefault().notify(new NotifyDescriptor.Confirmation(
            Bundle.ProblemNotification_ignore_question(job.getDisplayName(), job.getInstance().getName()),
            Bundle.ProblemNotification_ignore_title(job.getDisplayName()),
            NotifyDescriptor.OK_CANCEL_OPTION)) == NotifyDescriptor.OK_OPTION) {
        job.setSalient(false);
    }
}
 
Example #30
Source File: HudsonJobImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages({"# {0} - job name", "MSG_Starting=Starting {0}"})
@Override public void start() {
    ProgressHandle handle = ProgressHandleFactory.createHandle(
            MSG_Starting(this.getName()));
    handle.start();
    try {
        instance.getBuilderConnector().startJob(this);
    } finally {
        handle.finish();
    }
    instance.synchronize(false);
}