Java Code Examples for org.openide.util.NbBundle.Messages

The following examples show how to use org.openide.util.NbBundle.Messages. These examples are extracted from open source projects. 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 Project: netbeans   Source File: GroupEditPanel.java    License: 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 2
Source Project: netbeans   Source File: IDENativeMavenWizardIterator.java    License: 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 3
Source Project: netbeans   Source File: ExtraPanel.java    License: 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 4
Source Project: netbeans   Source File: POMModelVisitor.java    License: 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 5
Source Project: netbeans   Source File: SiteDocsNode.java    License: 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 6
Source Project: netbeans   Source File: ModuleActions.java    License: 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 7
Source Project: netbeans   Source File: LibrariesCustomizer.java    License: 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 8
Source Project: netbeans   Source File: TrustProjectPanel.java    License: 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 9
Source Project: netbeans   Source File: ActionProviderImpl.java    License: 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 10
Source Project: netbeans   Source File: OpenBrandingEditorAction.java    License: 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 11
Source Project: netbeans   Source File: CustomizerLibraries.java    License: 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 12
Source Project: netbeans   Source File: CopyPathToClipboardAction.java    License: 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 13
Source Project: netbeans   Source File: SuiteCustomizerBasicBranding.java    License: 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 14
Source Project: netbeans   Source File: CompileOptionsPanel.java    License: 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 15
Source Project: netbeans   Source File: IniDataObject.java    License: 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 16
Source Project: netbeans   Source File: ProblemNotification.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "# {0} - job name",
    "# {1} - build number",
    "# Please translate only \"failed\"",
    "ProblemNotification.title.failed={0} #{1,number,#} failed",
    "# {0} - job name",
    "# {1} - build number",
    "# Please translate only \"is unstable\"",
    "ProblemNotification.title.unstable={0} #{1,number,#} is unstable"
})
private String getTitle() {
    // XXX use HudsonJobBuild.getDisplayName
    return failed ? Bundle.ProblemNotification_title_failed(job.getDisplayName(), build) : Bundle.ProblemNotification_title_unstable(job.getDisplayName(), build);
}
 
Example 17
Source Project: netbeans   Source File: GroovyActionsRegistration.java    License: Apache License 2.0 5 votes vote down vote up
@Messages("LBL_TestFile_Action=Test File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.test", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_TestFile_Action")
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-groovy/Actions", position = 580),
    @ActionReference(path = "Editors/text/x-groovy/Popup", position = 830)
})
public static Action test() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_TEST_SINGLE,
            LBL_TestFile_Action(),
            null);
}
 
Example 18
Source Project: netbeans   Source File: NodeWidget.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({"TIP_Text=<html>{0}<br>{1}</html>",
           "TIP_SingleConflict=Conflict with <b>{0}</b> version required by <b>{1}</b>",
           "TIP_SingleWarning=Warning, older version <b>{0}</b> requested by <b>{1}</b>",
           "TIP_MultipleConflict=Conflicts with:<table><thead><tr><th>Version</th><th>Artifact</th></tr></thead><tbody>",
           "TIP_MultipleWarning=Warning, older versions requested:<table><thead><tr><th>Version</th><th>Artifact</th></tr></thead><tbody>"})
private void updateTooltip () {
    DependencyGraphScene scene = getDependencyGraphScene();
    tooltipText = Bundle.TIP_Text(node.getTooltipText(), scene.supportsVersions() ? getConflictTooltip(node) : "");
    setToolTipText(tooltipText);
}
 
Example 19
Source Project: netbeans   Source File: SuiteActions.java    License: Apache License 2.0 5 votes vote down vote up
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.buildOsgiObr")
@ActionRegistration(displayName="#SUITE_ACTION_build_osgi_obr", lazy=false)
@ActionReference(path=SUITE_OSGI_ACTIONS_PATH, position=200)
@Messages("SUITE_ACTION_build_osgi_obr=Build Bundle Repository")
public static Action buildOsgiObr() {
    return ProjectSensitiveActions.projectCommandAction(COMMAND_BUILD_OSGI_OBR, SUITE_ACTION_build_osgi_obr(), null);
}
 
Example 20
Source Project: netbeans   Source File: ProjectFilesNode.java    License: Apache License 2.0 5 votes vote down vote up
@Messages("LBL_Project_Files=Project Files")
public ProjectFilesNode(NbMavenProjectImpl project) {
    super(Children.create(new ProjectFilesChildren(project), true), Lookups.fixed(project.getProjectDirectory(), new OthersRootNode.ChildDelegateFind()));
    setName("projectfiles"); //NOI18N
    setDisplayName(LBL_Project_Files());
    this.project = project;
    setMyFiles();
}
 
Example 21
Source Project: netbeans   Source File: NbBundleProcessorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "f1=problem with {0}",
    "# {0} - input file",
    "# {1} - pattern",
    "f2={0} did not match {1}",
    "LBL_BuildMainProjectAction_Name=&Build {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<{0} Projects}"
})
public void testMessageFormats() throws Exception {
    assertEquals("problem with stuff", f1("stuff"));
    assertEquals("1 did not match 2", f2(1, 2));
    assertEquals("&Build Main Project", LBL_BuildMainProjectAction_Name(-1, "whatever"));
    assertEquals("&Build Project", LBL_BuildMainProjectAction_Name(0, "whatever"));
    assertEquals("&Build Project (whatever)", LBL_BuildMainProjectAction_Name(1, "whatever"));
    assertEquals("&Build 2 Projects", LBL_BuildMainProjectAction_Name(2, "whatever"));
}
 
Example 22
Source Project: netbeans   Source File: RunAnalysisPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Messages("LBL_Configurations=Configurations")
private void manageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageActionPerformed
    AdjustConfigurationPanel panel = showConfigurationPanel(null, null, (Configuration) configurationCombo.getSelectedItem());
    if (panel != null) {
        panel.save();
        configurationCombo.setSelectedItem(panel.getSelectedConfiguration());
    }
}
 
Example 23
Source Project: netbeans   Source File: FixVersionConflictPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "FixVersionConflictPanel.addSetCheck.text={0} Direct Dependency",
    "FixVersionConflictPanel.excludeCheck.text=Exclude Transitive Dependency"
})
private void visualizeRecommendations(FixDescription recs) {
    addSetCheck.setText(FixVersionConflictPanel_addSetCheck_text(getSetText()));
    addSetCheck.setSelected(recs.isSet);
    addSetCheckChanged();

    List<ArtifactVersion> versions = getClashingVersions();
    DefaultListModel model = new DefaultListModel();
    for (ArtifactVersion av : versions) {
        model.addElement(av);
    }
    versionList.setModel(model);
    versionList.setSelectedIndex(0);

    if (recs.version2Set != null) {
        versionList.setSelectedValue(recs.version2Set, true);
    }

    excludeCheck.setText(FixVersionConflictPanel_excludeCheck_text());
    excludeCheck.setSelected(recs.isExclude);
    excludeCheckChanged();

    Set<Artifact> exclTargets = eTargets.getAll();
    if (!exclTargets.isEmpty()) {
        DefaultListModel lModel = new DefaultListModel();
        for (Artifact exc : exclTargets) {
            lModel.addElement(new ExclTargetEntry(exc,
                    recs.exclusionTargets != null && recs.exclusionTargets.contains(exc)));
        }
        excludesList.setModel(lModel);
    } else {
        excludeCheck.setEnabled(false);
    }

    updateSummary();
}
 
Example 24
Source Project: netbeans   Source File: SuiteActions.java    License: Apache License 2.0 5 votes vote down vote up
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.osgiMenu")
@ActionRegistration(displayName="#SUITE_ACTION_osgi_menu", lazy=false)
@ActionReference(path=SUITE_ACTIONS_PATH, position=1400)
@Messages("SUITE_ACTION_osgi_menu=OSGi")
public static Action osgiMenu() {
    return new SubMenuAction(SUITE_ACTION_osgi_menu(), Arrays.asList(CommonProjectActions.forType(SUITE_OSGI_ACTIONS_TYPE)));
}
 
Example 25
Source Project: netbeans   Source File: AvailableTableModel.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@Messages({
    "# {0} - file path",
    "unit_already_installed=Plugin {0} is already installed."})
public void setValueAt(Object anValue, int row, int col) {
    // second column is editable but doesn't want to edit its value
    if (isExpansionControlAtRow(row)) return;//NOI18N        
    if (col == 1) {
        return ;
    }
    super.setValueAt(anValue, row, col);
    if (anValue == null) {
        return ;
    }
    //assert getCategoryAtRow (row).isExpanded ();
    Unit.Available u = (Unit.Available) getUnitAtRow(row);
    assert anValue instanceof Boolean : anValue + " must be instanceof Boolean.";
    if (u == null) {
        return ;
    }
    boolean beforeMarked = u.isMarked();
    if ((Boolean) anValue != beforeMarked) {
        u.setMarked(! beforeMarked);
        if (u.isMarked() != beforeMarked) {
            fireButtonsChange();
        } else {
            if (u.getRelevantElement().getUpdateUnit().getInstalled() != null) {
                // already installed => refresh model
                fireUpdataUnitChange();
                DialogDisplayer.getDefault().notifyLater(
                        new NotifyDescriptor.Message(unit_already_installed(u.getDisplayName()), NotifyDescriptor.WARNING_MESSAGE));
            } else {
                //TODO: message should contain spec.version
                String message = getBundle ("NotificationAlreadyPreparedToIntsall", u.getDisplayName ()); // NOI18N
                DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(message));
            }
        }
    }
}
 
Example 26
Source Project: netbeans   Source File: TemplateOperation.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "# {0} - Folder name",
    "MSG_CREATE_FOLDER=Creating foder: {0}"
})
public void createFolder(File target) {
    steps.add(new CreateDirStep(target, MSG_CREATE_FOLDER(target.getName())));
}
 
Example 27
Source Project: netbeans   Source File: PackageRootNode.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "PROP_name=Name",
    "HINT_name=Package Name",
    "PROP_rootpath=Source Root",
    "HINT_rootpath=Source Root"
})
@Override public PropertySet[] getPropertySets() {
    final PropertySet[] properties =  getDataFolderNodeDelegate().getPropertySets();
    final PropertySet[] newProperties = Arrays.copyOf(properties, properties.length);
    for (int i=0; i< newProperties.length; i++) {
        if (Sheet.PROPERTIES.equals(newProperties[i].getName())) {
            //Replace the Sheet.PROPERTIES by the new one
            //having the ro name property and ro path property
            newProperties[i] = Sheet.createPropertiesSet();
            ((Sheet.Set)newProperties[i]).put(new PropertySupport.ReadOnly<String>(DataObject.PROP_NAME, String.class,
                    PROP_name(), HINT_name()) {
                @Override
                public String getValue() {
                    return PackageRootNode.this.getDisplayName();
                }
            });
            ((Sheet.Set)newProperties[i]).put(new PropertySupport.ReadOnly<String>("ROOT_PATH", String.class,    //NOI18N
                    PROP_rootpath(), HINT_rootpath()) {
                @Override
                public String getValue() {
                    return FileUtil.getFileDisplayName(PackageRootNode.this.file);
                }
            });
        }
    }
    return newProperties;
}
 
Example 28
Source Project: netbeans   Source File: PUDataObject.java    License: Apache License 2.0 5 votes vote down vote up
@MultiViewElement.Registration(
    mimeType=PUDataLoader.REQUIRED_MIME,
    iconBase=ICON,
    persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
    preferredID=PREFERRED_ID_SOURCE,
    displayName="#CTL_SourceTabCaption",
    position=2000
)
@Messages("CTL_SourceTabCaption=Source")
public static XmlMultiViewElement createXmlMultiViewElement(Lookup lookup) {
    return new XmlMultiViewElement(lookup.lookup(XmlMultiViewDataObject.class));
}
 
Example 29
Source Project: netbeans   Source File: ModifiersCheckHintError.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@Messages({
    "# {0} - Modifier name",
    "AddModifierFixDesc=Add modifier: {0}"
})
public String getDescription() {
    return Bundle.AddModifierFixDesc(modifier);
}
 
Example 30
Source Project: netbeans   Source File: VersionNode.java    License: Apache License 2.0 5 votes vote down vote up
@Messages({
    "DownloadAction_sources_label=Download Sources",
    "DownloadAction_javadoc_label=Download Javadoc"
})
DownloadAction(Artifact primaryArt, boolean javadoc) {
    super(javadoc ? DownloadAction_javadoc_label() : DownloadAction_sources_label());
    art = EmbedderFactory.getProjectEmbedder().createArtifactWithClassifier(primaryArt.getGroupId(), primaryArt.getArtifactId(), primaryArt.getVersion(), "jar", javadoc ? "javadoc" : "sources");
    primary = false;
    setEnabled((javadoc ? hasJavadoc : hasSources) && info.isRemoteDownloadable() && !FileUtilities.convertArtifactToLocalRepositoryFile(art).isFile());
}