当前位置: 首页>>代码示例>>Java>>正文


Java NbBundle.getMessage方法代码示例

本文整理汇总了Java中org.openide.util.NbBundle.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java NbBundle.getMessage方法的具体用法?Java NbBundle.getMessage怎么用?Java NbBundle.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.util.NbBundle的用法示例。


在下文中一共展示了NbBundle.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hint

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@TriggerPattern(value="synchronized ($this) { $stmts$; }")
public static ErrorDescription hint(HintContext ctx) {
    TreePath thisVariable = ctx.getVariables().get("$this");
    if (thisVariable.getLeaf().getKind() != Kind.IDENTIFIER || !((IdentifierTree) thisVariable.getLeaf()).getName().contentEquals(THIS_KEYWORD)) {
        return null;
    }
    
    TreePath anonClassTP = getParentClass(ctx.getPath());
    Element annonClass = ctx.getInfo().getTrees().getElement(anonClassTP);
    String key = getKey(annonClass);
    if (key != null) {
        Element parent = ctx.getInfo().getTrees().getElement(getParentClass(anonClassTP.getParentPath()));

        if (parent == null || (!parent.getKind().isClass() && !parent.getKind().isInterface())) {
            return null;
        }
        
        Fix fix = new FixImpl(TreePathHandle.create(thisVariable, ctx.getInfo()),
                     ElementHandle.create((TypeElement) parent)).toEditorFix();

        String displayName = NbBundle.getMessage(ThisInAnonymous.class, key);
        return ErrorDescriptionFactory.forName(ctx, thisVariable, displayName, fix);
    }

    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ThisInAnonymous.java

示例2: run

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
public void run(CompilationController javac) throws Exception {
    for (ElementHandle<ExecutableElement> method : allMethods) {
        ExecutableElement el = method.resolve(javac);
        Collection<ExecutableElement> overriddenMethods = JavaRefactoringUtils.getOverriddenMethods(el, javac);
        for (ExecutableElement overriddenMethod : overriddenMethods) {
            ElementHandle<ExecutableElement> handle = ElementHandle.create(overriddenMethod);
            if(!allMethods.contains(handle)) {
                TypeElement type1 = javac.getElementUtilities().enclosingTypeElement(el);
                TypeElement type2 = javac.getElementUtilities().enclosingTypeElement(overriddenMethod);
                Problem prob = new Problem(false, NbBundle.getMessage(OverriddenAbsMethodFinder.class, "WRN_Implements", overriddenMethod.getSimpleName(), type1.getQualifiedName(), type2.getQualifiedName()));
                problem = JavaPluginUtils.chainProblems(problem, prob);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:OverriddenAbsMethodFinder.java

示例3: commitOrRollback

import org.openide.util.NbBundle; //导入方法依赖的package包/类
protected void commitOrRollback(String cmdName) {
    if (!error && commit(conn)) {
        long executionTime = System.currentTimeMillis() - startTime;
        String execTimeStr = SQLExecutionHelper.millisecondsToSeconds(executionTime);
        String infoMsg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_execution_success", execTimeStr);
        dataView.setInfoStatusText(infoMsg);
        executeOnSucess(); // delegate 
    } else {
        rollback(conn);
        reinstateToolbar();

        String msg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_failed");
        if (ex == null) {
            errorMsg = msg + " " + errorMsg;
        } else {
            errorMsg = msg;
        }

        ex = new DBException(errorMsg, ex);
        dataView.setErrorStatusText(conn, null, ex);

        NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notify(nd);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:SQLStatementExecutor.java

示例4: getTooltipForCheckBox

import org.openide.util.NbBundle; //导入方法依赖的package包/类
private String getTooltipForCheckBox(int row) {
    String key0 = null;
    switch (getType()) {
        case INSTALLED:
            key0 = "UnitTab_TooltipCheckBox_INSTALLED"; //NOI18N
            break;
        case UPDATE:
            key0 = "UnitTab_TooltipCheckBox_UPDATE"; //NOI18N
            break;
        case AVAILABLE:
            key0 = "UnitTab_TooltipCheckBox_AVAILABLE"; //NOI18N
            break;
        case LOCAL:
            key0 = "UnitTab_TooltipCheckBox_LOCAL"; //NOI18N
            break;
    }
    return (key0 != null) ? NbBundle.getMessage (UnitCategoryTableModel.class, key0, (String)getValueAt (row, 1)) : null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:UnitCategoryTableModel.java

示例5: show

import org.openide.util.NbBundle; //导入方法依赖的package包/类
boolean show() {
    panel.cbUpdateIndex.addActionListener(this);
    okButton = new JButton(NbBundle.getMessage(CheckoutPaths.class, "LBL_CheckoutPaths.OKButton.text")); //NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(okButton, okButton.getText());
    dd = new DialogDescriptor(panel, NbBundle.getMessage(CheckoutPaths.class, "LBL_CheckoutPaths.title"), true,  //NOI18N
            new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(CheckoutPaths.class), null);
    enableRevisionPanel();
    revisionPicker.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange (PropertyChangeEvent evt) {
            if (evt.getPropertyName() == RevisionDialogController.PROP_VALID) {
                setValid(Boolean.TRUE.equals(evt.getNewValue()));
            }
        }
    });
    Dialog d = DialogDisplayer.getDefault().createDialog(dd);
    d.setVisible(true);
    return okButton == dd.getValue();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CheckoutPaths.java

示例6: getUndoPresentationName

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
   public String getUndoPresentationName() {
UndoableEdit last = lastEdit();
if (last != null) {
    return last.getUndoPresentationName();
} else {
           String name = getPresentationName();
           if (!"".equals(name)) {
               name = NbBundle.getMessage(ContentEdit.class, "AbstractUndoableEdit.undoText.param", name); // NOI18N
           } else {
               name = NbBundle.getMessage(ContentEdit.class, "AbstractUndoableEdit.undoText"); // NOI18N
           }

           return name;
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:StableCompoundEdit.java

示例7: getTableCellRendererComponent

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    String strValue = "";   //NOI18N
    String toolTip = null;
    Icon icon = null;
    if (value instanceof Boolean) {
        strValue = NbBundle.getMessage(JFXDownloadModePanel.class, value == Boolean.TRUE ? "TXT_LAZY":"TXT_EAGER"); //NOI18N
    } else if (value instanceof File) {
        final File f = (File)value;
        strValue = f.getName();
        toolTip = f.getAbsolutePath();
        icon = JAR_ICON;
    }
    final Component c = super.getTableCellRendererComponent(
            table,
            strValue, //NOI18N
            isSelected,
            hasFocus,
            row,
            column);
    if (c instanceof JLabel) {
        JLabel label = (JLabel) c;
        label.setToolTipText (toolTip);
        label.setIcon(icon);
    }
    return c;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:JFXDownloadModePanel.java

示例8: setState

import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Sets state of all categories according to given value.
 * @param state new state
 */
void setState(State state) {
    String passwords = NbBundle.getMessage(OptionsChooserPanel.class, "OptionsChooserPanel.export.passwords.category.displayName");
    for (OptionsExportModel.Category category : getCategories()) {
        if (category.isApplicable()) {
            if (state.equals(State.ENABLED)) {
                if (category.getDisplayName() != null && !category.getDisplayName().equals(passwords)) {
                    category.setState(state);
                }
            } else {
                category.setState(state);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:OptionsExportModel.java

示例9: createFromTemplate

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
public FileObject createFromTemplate(FileObject f, String name) throws IOException {
    if (getFile().getAttribute(/* ScriptingCreateFromTemplateHandler.SCRIPT_ENGINE_ATTR */"javax.script.ScriptEngine") == null) {
        Logger.getLogger(JavaDataLoader.class.getName()).log(Level.WARNING, "Please replace template {0} with the new scripting support. See http://bits.netbeans.org/7.1/javadoc/org-openide-loaders/apichanges.html#scripting", getFile().getPath());
    }
    if (name == null) {
        // special case: name is null (unspecified or from one-parameter createFromTemplate)
        name = FileUtil.findFreeFileName(f, f.getName(), "java"); // NOI18N
    } else if (!PACKAGE_INFO.equals(name) && !Utilities.isJavaIdentifier(name)) {
        throw new IOException(NbBundle.getMessage(JavaDataObject.class, "FMT_Not_Valid_FileName", name));
    }
    
    this.initializeIndentEngine();
    FileObject fo = super.createFromTemplate(f, name);
    
    ClassPath cp = ClassPath.getClassPath(fo, ClassPath.SOURCE);
    String pkgName;
    if (cp != null) {
        pkgName = cp.getResourceName(f, '.', false);
        if (pkgName == null) {
            Logger.getLogger(JavaDataLoader.class.getName()).log(Level.WARNING, "{0} is not on its own source path", FileUtil.getFileDisplayName(fo));
            pkgName = "";
        }
    } else {
        pkgName = "";   //NOI18N
    }
    JavaDataObject.renameFO(fo, pkgName, name, getFile().getName());
    
    // unfortunately JavaDataObject.renameFO creates JavaDataObject but it is too soon
    // in this stage. Loaders reusing this FileEntry will create further files.
    destroyDataObject(fo);
    
    return fo;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:JavaDataLoader.java

示例10: ClassMemberPanelUI

import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Creates new form ClassMemberPanelUi */
public ClassMemberPanelUI(final Language language) {
    
    initComponents();
    
    // Tree view of the elements
    elementView = createBeanTreeView();        
    add(elementView, BorderLayout.CENTER);
           
    filters = new ClassMemberFilters( this );
    filters.getInstance().hookChangeListener(this);

    // See http://www.netbeans.org/issues/show_bug.cgi?id=186407
    // Making the calls to getStructure() out of AWT EDT
    RP.post(new UpdateFilterState(language));
    
                        // filters
                        filtersPanel = new TapPanel();
                        filtersLbl = new JLabel(NbBundle.getMessage(ClassMemberPanelUI.class, "LBL_Filter")); //NOI18N
                        filtersLbl.setBorder(new EmptyBorder(0, 5, 5, 0));
                        filtersPanel.add(filtersLbl);
                        filtersPanel.setOrientation(TapPanel.DOWN);
                        // tooltip
                        KeyStroke toggleKey = KeyStroke.getKeyStroke(KeyEvent.VK_T,
                                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
                        String keyText = Utilities.keyToString(toggleKey);
                        filtersPanel.setToolTipText(NbBundle.getMessage(ClassMemberPanelUI.class, "TIP_TapPanel", keyText));
                        filtersPanel.add(filters.getComponent());
                        add(filtersPanel, BorderLayout.SOUTH);  
    manager.setRootContext(ElementNode.getWaitNode());
    
    lookup = ExplorerUtils.createLookup(manager, getActionMap());       
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:ClassMemberPanelUI.java

示例11: getPanel

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
   public CustomRefactoringPanel getPanel(ChangeListener parent) {
if (panel == null) {
    panel = new RenamePanel(context.getElementName(), parent, NbBundle.getMessage(RenamePanel.class, "LBL_Rename"), true, true); //NOI18N
}

return panel;
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:CPRenameRefactoringUI.java

示例12: getValue

import org.openide.util.NbBundle; //导入方法依赖的package包/类
public String getValue(final JTextComponent component, final Document document, Object attributeKey, final int startOffset, final int endOffset) {
    return resolveWarnings(document, startOffset, endOffset) + NbBundle.getMessage(AnnotationHolder.class, "LBL_shortcut_promotion");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:AnnotationHolder.java

示例13: getDisplayHint

import org.openide.util.NbBundle; //导入方法依赖的package包/类
public String getDisplayHint() {
    return NbBundle.getMessage(ClasspathNavigatorProviderImpl.class, "SD_Classpath");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ClasspathNavigatorProviderImpl.java

示例14: getName

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
   public String getName() {
return NbBundle.getMessage(CPRenameRefactoringUI.class, "LBL_Rename"); //NOI18N
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:CPRenameRefactoringUI.java

示例15: getBundleText

import org.openide.util.NbBundle; //导入方法依赖的package包/类
private static String getBundleText(String key) {
    return NbBundle.getMessage(QueryTopComponent.class, key);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:QueryTopComponent.java


注:本文中的org.openide.util.NbBundle.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。