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


Java NbBundle.Messages方法代码示例

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


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

示例1: actionPerformed

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "# 0 - message from the script execution",
    "ERR_ExecutingScript=Error executing saved snippets: {0}"
})
@Override
public void actionPerformed(ActionEvent e) {
    if (context == null || editor == null || scriptFile == null) {
        return;
    }
    FileObject consoleFile = context.lookup(FileObject.class);
    if (consoleFile == null) {
        return;
    }
    ShellSession s = ShellSession.get(editor.getDocument());
    if (s == null) {
        return;
    }
    try {
        runScript(scriptFile, s);
    } catch (IOException ex) {
        NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.ERR_ExecutingScript(ex.getLocalizedMessage()), NotifyDescriptor.ERROR_MESSAGE);
        org.openide.DialogDisplayer.getDefault().notify(msg);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:RunScriptAction.java

示例2: openSearchHistory

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({"CTL_ShowHistoryTitle=Show History",
                    "# {0} - path to be opened",  "MSG_NoHistory=History View not available for file with path\n {0}."})
private static void openSearchHistory(final String path, final int line) {
    if(path == null) {
        return;
    }
    final IDEServices ideServices = Support.getInstance().getIDEServices();
    if(ideServices == null || !ideServices.providesOpenHistory()) {
        return;
    }
    Support.getInstance().getParallelRP().post(new Runnable() {
        @Override
        public void run() {
            if(!ideServices.openHistory(path, line)) {
                Util.notifyError(Bundle.CTL_ShowHistoryTitle(), Bundle.MSG_NoHistory(path));
            }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:StackTraceSupport.java

示例3: getValue

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
@NbBundle.Messages("LBL_ViewDiff=&View Difference")
public Object getValue(String key) {
    if (NAME.equals(key)) {
        return Bundle.LBL_ViewDiff();
    }
    return super.getValue(key);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DiffViewAction.java

示例4: LazyMenu

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages("LBL_SubProjectPopupMenu_Initializing=Initializing...")
private LazyMenu(Node[] nodes) {
    super(LBL_OpenSubprojectsAction_Name());
    this.activatedNodes = nodes;
    JMenuItem item = new JMenuItem(Bundle.LBL_SubProjectPopupMenu_Initializing());
    item.setEnabled(false);
    add(item);
    RP.post(new Runnable() {
        @Override
        public void run() {
            getSubProjects();
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:OpenSubprojects.java

示例5: readFromDataModel

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "MSG_LaunchingApplication=Launching your application"
})
@Override
protected void readFromDataModel() {
    checkValidity();
    if (task == null) {
        try {
            task = DesignSupport.invokeDesignMode(data.getProject(), userDir, false, !data.isIgnorePreviousRun());
        } catch (IOException ex) {
            setError(ex.getMessage());
        }
        if(task != null) {
            handle = ProgressHandleFactory.createHandle(Bundle.MSG_LaunchingApplication());
            JComponent pc = ProgressHandleFactory.createProgressComponent(handle);
            JLabel ml = ProgressHandleFactory.createMainLabelComponent(handle);

            progress.add(ml);
            progress.add(pc);

            handle.start();
            markInvalid();
            /* XXX what was the purpose of this? cannot do it now, we are in EQ
            try {
                DesignSupport.existingModes(data);
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            }
            */
            task.addTaskListener(this);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:LayoutLaunchingPanel.java

示例6: createCfgPanel

import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
     * Creates a configuration panel.
     *
     * @param nodes  nodes selected when the Create Tests action was invoked
     * @param isShowMsgFilesWillBeSaved if {@code true} then a warning message
     *        like "Warning: All modified files will be saved." will be
     *        displayed on the panel, otherwise (i.e. if {@code false}) then
     *        the message won't be displayed.
     */
    @NbBundle.Messages({"MSG_J2ME_PROJECT_TYPE=Tests cannot be created for this project type. Please use the New File wizard to create a JMUnit test instead.",
    "MSG_MODIFIED_FILES=Warning: All modified files will be saved."
    })
    public void createCfgPanel(boolean isShowMsgFilesWillBeSaved, boolean isJ2meProject) {
//        assert (nodes != null) && (nodes.length != 0);
//        this.nodes = nodes;
        multipleClasses = checkMultipleClasses();
        this.isJ2meProject = isJ2meProject;
        
        initBundle();
        try {
            initComponents();
            if(isShowMsgFilesWillBeSaved) {
                String msg = Bundle.MSG_MODIFIED_FILES();
                setMessage(msg, MSG_TYPE_MODIFIED_FILES);
            }
            if(isJ2meProject) {
                setMessage(Bundle.MSG_J2ME_PROJECT_TYPE(), MSG_TYPE_J2ME_PROJECT);
            }
            setBorder(BorderFactory.createEmptyBorder(12, 12, 0, 11));
            addAccessibleDescriptions();
            initializeCheckBoxStates();
            if (testCreatorConfiguration != null) {
                fillFormData();
            }
            checkAcceptability();
            
            /*
             * checkAcceptability() must not be called
             *        before initializeCheckBoxStates() and fillFormData()
             * setupUserInteraction must not be called
             *        before initializeCheckBoxStates()
             */
            
        } finally {
            unlinkBundle();
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:CommonTestsCfgOfCreate.java

示例7: writeSQLWarning

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "# {0} - error code", 
    "# {1} - error sql state", 
    "# {2} - error message", 
    "LBL_WarningCodeStateMessage=[Warning, Error code {0}, SQLState {1}] {2}"})
private void writeSQLWarning(SQLWarning e, OutputWriter writer) {
    writer.println(LBL_WarningCodeStateMessage(
            e.getErrorCode(),
            e.getSQLState(),
            e.getMessage()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SQLExecutionLoggerImpl.java

示例8: getShortDescription

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "# {0} - validity message",
    "TOOLTIP_BREAKPOINT_BROKEN_INVALID=Unresolved breakpoint: {0}",
    "TOOLTIP_BREAKPOINT_BROKEN=Unresolved breakpoint",
    "TOOLTIP_BREAKPOINT=Line Breakpoint",
    "TOOLTIP_DISABLED_BREAKPOINT=Disabled Line Breakpoint",
    "TOOLTIP_CONDITIONAL_BREAKPOINT=Conditional Breakpoint",
    "TOOLTIP_DISABLED_CONDITIONAL_BREAKPOINT=Disabled Conditional Breakpoint",
    "TOOLTIP_ALL_BREAKPOINTS_DEACTIVATED=All breakpoints are deactivated"
})
@Override
public String getShortDescription() {
    if (type.endsWith("_broken")) {
        if (breakpoint.getValidity() == Breakpoint.VALIDITY.INVALID) {
            String msg = breakpoint.getValidityMessage();
            return Bundle.TOOLTIP_BREAKPOINT_BROKEN_INVALID(msg);
        }
        return Bundle.TOOLTIP_BREAKPOINT_BROKEN();
    }
    if (type == BREAKPOINT_ANNOTATION_TYPE) {
        return Bundle.TOOLTIP_BREAKPOINT();
    }
    if (type == DISABLED_BREAKPOINT_ANNOTATION_TYPE) {
        return Bundle.TOOLTIP_DISABLED_BREAKPOINT();
    }
    if (type == CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE) {
        return Bundle.TOOLTIP_CONDITIONAL_BREAKPOINT();
    }
    if (type == DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE) {
        return Bundle.TOOLTIP_DISABLED_CONDITIONAL_BREAKPOINT();
    }
    if (type.endsWith(DEACTIVATED_BREAKPOINT_SUFFIX)) {
        return Bundle.TOOLTIP_ALL_BREAKPOINTS_DEACTIVATED();
    }
    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, new IllegalStateException("Unknown breakpoint type '"+type+"'."));
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:LineBreakpointAnnotation.java

示例9: getColumnName

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "MappingsTableModel.column.input.title=Input",
    "MappingsTableModel.column.output.title=Output",
})
@Override
public String getColumnName(int columnIndex) {
    if (columnIndex == 0) {
        return Bundle.MappingsTableModel_column_input_title();
    }
    if (columnIndex == 1) {
        return Bundle.MappingsTableModel_column_output_title();
    }
    throw new IllegalStateException("Unknown column index: " + columnIndex);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:OptionsPanel.java

示例10: confirmOverallModifications

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "MSG_PullAction.progress.checkForModifications=Checking for local modifications",
    "LBL_PullAction.localModifications.title=Confirm Pull with Local Modifications",
    "MSG_PullAction.localModifications.text=There are local modifications that may prevent from subsequent merge or rebase.\n"
        + "Do you still want to perform the Pull?",
})
private static Boolean confirmOverallModifications (File root, HgProgressSupport supp) {
    Boolean confirmed = null;
    supp.setDisplayName(Bundle.MSG_PullAction_progress_checkForModifications());
    int interestingStatus = FileInformation.STATUS_LOCAL_CHANGE & ~FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY;
    try {
        Map<File, FileInformation> statuses = HgCommand.getStatus(root,
                Collections.<File>singletonList(root), null, null, false);
        for (Map.Entry<File, FileInformation> e : statuses.entrySet()) {
            FileInformation info = e.getValue();
            if ((info.getStatus() & interestingStatus) != 0) {
                confirmed = JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null, 
                        Bundle.MSG_PullAction_localModifications_text(),
                        Bundle.LBL_PullAction_localModifications_title(), 
                        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                break;
            }
        }
    } catch (HgException ex) {
        Mercurial.LOG.log(Level.INFO, null, ex);
    }
    return confirmed;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:PullAction.java

示例11: updateAttachmentsStatus

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "# {0} - icon path",
    "IssuePanel.attachmentsToSubmit=<p><img src=\"{0}\">&nbsp;Unsubmitted Attachments</p>"
        + "<p>New attachments were added but not yet submitted</p>",
    "IssuePanel.attachmentsAddedLocally=Attachments were added but not yet submitted"
})
private void updateAttachmentsStatus () {
    boolean change = false;
    if (!issue.isNew()) {
        boolean valueModifiedByUser = !issue.getUnsubmittedAttachments().isEmpty();
        removeTooltips(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS);
        AbstractButton attachmentsLabel = attachmentsSection.getLabelComponent();
        if (attachmentsLabel.getFont().isBold()) {
            attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() & ~Font.BOLD));
        }
        if (valueModifiedByUser) {
            String message = Bundle.IssuePanel_attachmentsAddedLocally();
            tooltipsLocal.addTooltip(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS,
                    Bundle.IssuePanel_attachmentsToSubmit(ICON_UNSUBMITTED_PATH));
            change = !message.equals(fieldsLocal.put(IssueField.NB_NEW_ATTACHMENTS, message));
        } else {
            change = fieldsLocal.remove(IssueField.NB_NEW_ATTACHMENTS) != null;
        }
        updateIcon(attachmentsWarning);
        if (unsavedFields.contains(IssueField.NB_NEW_ATTACHMENTS.getKey())) {
            attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() | Font.BOLD));
        }
    }
    if (change && !reloading) {
        updateMessagePanel();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:IssuePanel.java

示例12: getHtmlDisplayName

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({
    "MSG_TestsuiteNoname=Test suite",
    "MSG_TestsuiteRunning_HTML=running..."})
@Override
public String getHtmlDisplayName() {
    
    assert suiteName != null;
    
    StringBuilder buf = new StringBuilder(60);
    if (suiteName != TestSuite.ANONYMOUS_SUITE) {
        buf.append(suiteName);
    } else {
        buf.append(Bundle.MSG_TestsuiteNoname());
    }
    if (report != null) {
        Status status = report.getStatus();
        buf.append("&nbsp;&nbsp;");                                 //NOI18N

        buf.append("<font color='#");                               //NOI18N
        buf.append(status.getHtmlDisplayColor()).append("'>");       //NOI18N
        buf.append(suiteStatusToMsg(status, true));
        buf.append("</font>");                                      //NOI18N
    } 
    if (report == null || !report.isCompleted()){
        buf.append("&nbsp;&nbsp;");                                 //NOI18N
        buf.append(Bundle.MSG_TestsuiteRunning_HTML());
    }
    return buf.toString();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:TestsuiteNode.java

示例13: compile

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages("SassCli.compile=Sass (compile)")
public void compile(File workDir, File source, final File target, List<String> compilerOptions) throws ExecutionException {
    assert !EventQueue.isDispatchThread();
    assert workDir.isDirectory() : "Not directory given: " + workDir;
    assert source.isFile() : "Not file given: " + source;
    final File targetDir = target.getParentFile();
    if (!targetDir.isDirectory()) {
        if (!targetDir.mkdirs()) {
            LOGGER.log(Level.WARNING, "Cannot create directory {0}", targetDir);
            return;
        }
    }
    try {
        getExecutable(Bundle.SassCli_compile(), workDir)
                .additionalParameters(getParameters(source, target, compilerOptions))
                .runAndWait(getDescriptor(new Runnable() {
            @Override
            public void run() {
                FileUtil.refreshFor(targetDir);
                UiUtils.refreshCssInBrowser(target);
            }
        }), "Compiling sass files..."); // NOI18N
    } catch (CancellationException ex) {
        // cancelled
    } catch (ExecutionException ex) {
        LOGGER.log(Level.INFO, null, ex);
        throw ex;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:SassCli.java

示例14: getPopupPresenter

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages("LBL_DisplayAllJavaFrames=Display all Java frames")
@Override
public JMenuItem getPopupPresenter() {
    cbb.setSelected(!displayJSStacks);
    return cbb;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:DebuggingJSFramesInJavaModelFilter.java

示例15: getData

import org.openide.util.NbBundle; //导入方法依赖的package包/类
@NbBundle.Messages({"ClassesListController_ResultNotAvailableString=N/A",
                        "ClassesListController_CompareFailed=Failed to load the heap dump to compare."})
    public Object[][] getData(String[] filterStrings, int filterType, boolean showZeroInstances, boolean showZeroSize,
                                         int sortingColumn, boolean sortingOrder, int columnCount) {
        boolean diff = isDiff();
        boolean retained = classesController.getHeapFragmentWalker().getRetainedSizesStatus() == HeapFragmentWalker.RETAINED_SIZES_COMPUTED;
        
        long totalLiveInstances = classesController.getHeapFragmentWalker().getTotalLiveInstances();
        long totalLiveBytes = classesController.getHeapFragmentWalker().getTotalLiveBytes();

        List classes = getFilteredSortedClasses(filterStrings, filterType,
                showZeroInstances, showZeroSize, sortingColumn, sortingOrder);
        Object[][] data = new Object[classes.size()][columnCount + 1];
        
        minDiff = Long.MAX_VALUE;
        maxDiff = Long.MIN_VALUE;

        for (int i = 0; i < classes.size(); i++) {
            JavaClass jClass = (JavaClass) classes.get(i);
            
            int instancesCount = jClass.getInstancesCount();
//                            int instanceSize = jClass.getInstanceSize();
            long allInstancesSize = jClass.getAllInstancesSize();
            long retainedSizeByClass = -1;

            if (retained) {
                retainedSizeByClass = jClass.getRetainedSizeByClass();
            }
            data[i][0] = jClass.getName();
            
            if (diff) { 
                minDiff = Math.min(minDiff, instancesCount);
                maxDiff = Math.max(maxDiff, instancesCount);
                data[i][1] = new Long(instancesCount);
                data[i][2] = (instancesCount > 0 ? "+" : "") + numberFormat.format(instancesCount); // NOI18N
                data[i][3] = (allInstancesSize > 0 ? "+" : "") + numberFormat.format(allInstancesSize); // NOI18N
                if (retained) {
                    if (!compareRetained) data[i][4] = Bundle.ClassesListController_ResultNotAvailableString();
                    else data[i][4] = (retainedSizeByClass > 0 ? "+" : "") + numberFormat.format(retainedSizeByClass); // NOI18N 
                }
            } else {
                data[i][1] = new Double((double) instancesCount /
                                     (double) totalLiveInstances * 100);
                data[i][2] = numberFormat.format(instancesCount) + " (" // NOI18N
                                     + percentFormat.format((double) instancesCount /
                                     (double) totalLiveInstances) + ")"; // NOI18N
                data[i][3] = (allInstancesSize < 0) ? Bundle.ClassesListController_ResultNotAvailableString()
                                      : (numberFormat.format(allInstancesSize) + " (" // NOI18N
                                      + percentFormat.format((double) allInstancesSize /
                                      (double) totalLiveBytes) + ")"); // NOI18N
                if (retained) {
                    data[i][4] = (retainedSizeByClass < 0) ? Bundle.ClassesListController_ResultNotAvailableString()
                                      : (numberFormat.format(retainedSizeByClass) + " (" // NOI18N
                                      + percentFormat.format((double) retainedSizeByClass /
                                      (double) totalLiveBytes) + ")"); // NOI18N
                }
            }
            
            data[i][columnCount] = diff ? ((DiffJavaClass)jClass).getJavaClass() : jClass;
        }
        
        if ((minDiff > 0) && (maxDiff > 0)) {
            minDiff = 0;
        } else if ((minDiff < 0) && (maxDiff < 0)) {
            maxDiff = 0;
        }
        
        return data;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:70,代码来源:ClassesListController.java


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