Java Code Examples for org.openide.util.NbBundle#getMessage()

The following examples show how to use org.openide.util.NbBundle#getMessage() . 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: PersistenceManager.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** @return Module folder for groups */
public FileObject getGroupsModuleFolder () throws IOException {
    try {
        if (groupsModuleFolder == null) {
            groupsModuleFolder = FileUtil.createFolder(
                getRootModuleFolder(), GROUPS_FOLDER
            );
        }
        return groupsModuleFolder;
    } catch (IOException exc) {
        String annotation = NbBundle.getMessage(PersistenceManager.class,
            "EXC_GroupsFolder", GROUPS_FOLDER);
        Exceptions.attachLocalizedMessage(exc, annotation);
        throw exc;
    }
}
 
Example 2
Source File: InterceptorGenerator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void invoke() {
    JButton ok = new JButton();
    Mnemonics.setLocalizedText(ok, NbBundle.getMessage(InterceptorGenerator.class, 
        "LBL_OK") );                                    // NOI18N
    JButton cancel = new JButton();
    Mnemonics.setLocalizedText(cancel, NbBundle.getMessage(InterceptorGenerator.class, 
        "LBL_Cancel"));                                 // NOI18N
    
    InterceptorPanel panel = new InterceptorPanel( ok , myBindingName, 
            myBindingFileObject);
    
    DialogDescriptor descriptor = new DialogDescriptor( panel, 
            NbBundle.getMessage(InterceptorGenerator.class, "TITLE_Interceptor",// NOI18N
                    myBindingName ),
            true, new Object[]{ ok, cancel },
            null, DialogDescriptor.DEFAULT_ALIGN, 
            new HelpCtx(InterceptorGenerator.class),
            null);
    descriptor.setClosingOptions( new Object[] { ok , cancel });
    Object closedOption = DialogDisplayer.getDefault().notify( descriptor );
    FileObject targetFolder = myBindingFileObject.getParent();
    if ( closedOption == ok && targetFolder != null ){
        createInterceptor(panel, targetFolder);
    }
}
 
Example 3
Source File: LogTableModel.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
@Override
public String getColumnName(int column) {
    switch (column) {
        case COL_TIME:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_TIME_NAME);
        case COL_PID:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_PID_NAME);
        case COL_PROCESS:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_PROCESS_NAME);
        case COL_MESSAGE:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_MESSAGE_NAME);
        case COL_TAG:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_TAG_NAME);
        case COL_LEVEL:
            return NbBundle.getMessage(getClass(), "LogCatColumn." + COL_LEVEL_NAME);
    }
    throw new IllegalArgumentException("This column does not exist: " + column);
}
 
Example 4
Source File: RevisionPicker.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public boolean open () {
    dd = new DialogDescriptor(panel, NbBundle.getMessage(RevisionPicker.class, "LBL_RevisionPickerDialog.title"), //NOI18N
            true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx("org.netbeans.modules.git.ui.repository.RevisionPickerDialog"), null); //NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    updateDialogState();
    browserPanel.addPropertyChangeListener(this);
    Preferences prefs = GitModuleConfig.getDefault().getPreferences();
    WindowListener windowListener = new DialogBoundsPreserver(prefs, this.getClass().getName());
    dialog.addWindowListener(windowListener);
    windowListener.windowOpened(new WindowEvent(dialog, WindowEvent.WINDOW_OPENED));
    dialog.pack();
    updateSliders(prefs);
    dialog.setVisible(true);
    persistSliders(prefs);
    browserPanel.removePropertyChangeListener(this);
    return dd.getValue() == okButton;
}
 
Example 5
Source File: NotifyDescriptor.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
* Get the title to use for the indicated type.
* @param messageType the type of message
* @return the title to use
*/
protected static String getTitleForType(int messageType) {
    switch (messageType) {
    case ERROR_MESSAGE:
        return NbBundle.getMessage(NotifyDescriptor.class, "NTF_ErrorTitle");

    case WARNING_MESSAGE:
        return NbBundle.getMessage(NotifyDescriptor.class, "NTF_WarningTitle");

    case QUESTION_MESSAGE:
        return NbBundle.getMessage(NotifyDescriptor.class, "NTF_QuestionTitle");

    case INFORMATION_MESSAGE:
        return NbBundle.getMessage(NotifyDescriptor.class, "NTF_InformationTitle");

    case PLAIN_MESSAGE:
        return NbBundle.getMessage(NotifyDescriptor.class, "NTF_PlainTitle");
    }

    return ""; // NOI18N
}
 
Example 6
Source File: NewPhpProjectWizardIterator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void starting() {
    handle.start(10);

    String msg = NbBundle.getMessage(
            NewPhpProjectWizardIterator.class, "LBL_NewPhpProjectWizardIterator_WizardProgress_CreatingProject");
    handle.progress(msg, 2);
}
 
Example 7
Source File: MacrosModel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public @Override String getColumnName(int columnIndex) {
    switch (columnIndex) {
        case NAME_COLUMN_IDX: // name
            return NbBundle.getMessage(MacrosModel.class, "MacrosTable_Name_Column_Title"); //NOI18N
        case SHORTCUTS_COLUMN_IDX: // shortcut
            return NbBundle.getMessage(MacrosModel.class, "MacrosTable_Shortcut_Column_Title"); //NOI18N
        default:
            throw new ArrayIndexOutOfBoundsException("Invalid column index: " + columnIndex); //NOI18N
    }
}
 
Example 8
Source File: FieldInjectionPointLogic.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void checkInjectionPoint( VariableElement element ) 
    throws InjectionPointDefinitionError
{
    CompilationController compilationController = getModel().getHelper().
        getCompilationController();
    Tree tree = compilationController.getTrees().getTree( element );
    if ( tree instanceof VariableTree ){
        VariableTree varTree = (VariableTree)tree;
        ExpressionTree initializer = varTree.getInitializer();
        if ( initializer != null ){
            throw new InjectionPointDefinitionError(NbBundle.getMessage( 
                    FieldInjectionPointLogic.class, 
                    "ERR_InitializedInjectionPoint"));      // NOI18N
        }
    }
    Set<Modifier> modifiers = element.getModifiers();
    if ( modifiers.contains(Modifier.STATIC)){
        throw new InjectionPointDefinitionError(NbBundle.getMessage( 
                FieldInjectionPointLogic.class, 
                "ERR_StaticInjectionPoint"));      // NOI18N
    }
    if ( modifiers.contains(Modifier.FINAL)){
        throw new InjectionPointDefinitionError(NbBundle.getMessage( 
                FieldInjectionPointLogic.class, 
                "ERR_FinalInjectionPoint"));      // NOI18N
    }
}
 
Example 9
Source File: DefaultPlugin.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 *
 */
private static String getCreatingMsg(String className) {
    return NbBundle.getMessage(
            DefaultPlugin.class,
            "FMT_generator_status_creating",                        //NOI18N
            className);
}
 
Example 10
Source File: MenuView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Helper method. Creates empty menu item. */
private static JMenuItem createEmptyMenuItem() {
    JMenuItem empty = new JMenuItem(NbBundle.getMessage(MenuView.class, "EmptySubMenu"));

    empty.setEnabled(false);

    return empty;
}
 
Example 11
Source File: Advanced.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static String loc (String key) {
    return NbBundle.getMessage (Advanced.class, key);
}
 
Example 12
Source File: WrongWeakHashMap.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String getHTMLDescription() {
    return NbBundle.getMessage(WrongWeakHashMap.class, "LBL_WWHM_LongDesc");
}
 
Example 13
Source File: ThreadsViewSupport.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
DataViewComponent.DetailsView getDetailsView() {
    return new DataViewComponent.DetailsView(NbBundle.getMessage(ThreadsViewSupport.class, "LBL_Timeline"), null, 10, this, null);  // NOI18N
}
 
Example 14
Source File: RemoveAction.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public String getName() {
    return NbBundle.getMessage(RemoveAction.class, "CTL_RemoveAction");
}
 
Example 15
Source File: ShowAllChangesAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public String getName() {
    return NbBundle.getMessage(ShowAllChangesAction.class, "CTL_MenuItem_ShowAllChanges_Label"); // NOI18N
}
 
Example 16
Source File: StopBuildingAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String getName() {
    return NbBundle.getMessage(StopBuildingAction.class, "LBL_stop_building");
}
 
Example 17
Source File: PackageDeleteRefactoringPlugin.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String getText() {
    return NbBundle.getMessage(FileDeletePlugin.class, "TXT_DeletePackage", dir.getName());
}
 
Example 18
Source File: TableSheet.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static String getString(String key) {
    return NbBundle.getMessage(TableSheet.class, key);
}
 
Example 19
Source File: ShowMotionSliderAction.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
public String getName() {
   return NbBundle.getMessage(ShowMotionSliderAction.class, "CTL_ShowMotionSliderAction");
}
 
Example 20
Source File: ConstraintIterator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String name() {
    return NbBundle.getMessage (ConstraintIterator.class, "TITLE_x_of_y",
        new Integer (index + 1), new Integer (panels.length));
}