本文整理汇总了Java中org.openide.util.NbBundle.getBundle方法的典型用法代码示例。如果您正苦于以下问题:Java NbBundle.getBundle方法的具体用法?Java NbBundle.getBundle怎么用?Java NbBundle.getBundle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.NbBundle
的用法示例。
在下文中一共展示了NbBundle.getBundle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wizard) {
wiz = wizard;
delegateIterator.initialize(wizard);
superclassPanelCurrent = false;
if (superclassPanel == null && specifySuperclass) {
superclassPanel = new SuperclassWizardPanel();
ResourceBundle bundle = NbBundle.getBundle(TemplateWizardIterator.class);
JComponent comp = (JComponent)delegateIterator.current().getComponent();
String[] contentData = (String[])comp.getClientProperty(WizardDescriptor.PROP_CONTENT_DATA); // NOI18N
String[] newContentData = new String[contentData.length+1];
System.arraycopy(contentData, 0, newContentData, 0, contentData.length);
newContentData[contentData.length] = bundle.getString("CTL_SuperclassTitle"); // NOI18N
comp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, newContentData); // NOI18N
}
}
示例2: initAccessibility
import org.openide.util.NbBundle; //导入方法依赖的package包/类
private void initAccessibility() {
ResourceBundle bundle = NbBundle.getBundle(ResultView.class);
AccessibleContext accessCtx;
OutlineView outlineView = resultsOutlineSupport.getOutlineView();
accessCtx = outlineView.getHorizontalScrollBar().getAccessibleContext();
accessCtx.setAccessibleName(
bundle.getString("ACSN_HorizontalScrollbar")); //NOI18N
accessCtx = outlineView.getVerticalScrollBar().getAccessibleContext();
accessCtx.setAccessibleName(
bundle.getString("ACSN_VerticalScrollbar")); //NOI18N
accessCtx = outlineView.getAccessibleContext();
accessCtx.setAccessibleName(
bundle.getString("ACSN_ResultTree")); //NOI18N
accessCtx.setAccessibleDescription(
bundle.getString("ACSD_ResultTree")); //NOI18N
}
示例3: getShortStatusText
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
* @return short status name for local changes, for remote
* changes returns <tt>""</tt>
*/
public String getShortStatusText() {
ResourceBundle loc = NbBundle.getBundle(FileInformation.class);
if (match(status, FileInformation.STATUS_NOTVERSIONED_EXCLUDED)) {
return loc.getString("CTL_FileInfoStatus_Excluded_Short");
} else if (match(status, FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY)) {
return loc.getString("CTL_FileInfoStatus_NewLocally_Short");
} else if (match(status, FileInformation.STATUS_VERSIONED_ADDEDLOCALLY)) {
if (entry != null && entry.isCopied()) {
return loc.getString("CTL_FileInfoStatus_AddedLocallyCopied_Short");
}
return loc.getString("CTL_FileInfoStatus_AddedLocally_Short");
} else if (status == FileInformation.STATUS_VERSIONED_REMOVEDLOCALLY) {
return loc.getString("CTL_FileInfoStatus_RemovedLocally_Short");
} else if (status == FileInformation.STATUS_VERSIONED_DELETEDLOCALLY) {
return loc.getString("CTL_FileInfoStatus_DeletedLocally_Short");
} else if (match(status, FileInformation.STATUS_VERSIONED_MODIFIEDLOCALLY)) {
return loc.getString("CTL_FileInfoStatus_ModifiedLocally_Short");
} else if (match(status, FileInformation.STATUS_VERSIONED_CONFLICT_TREE)) {
return loc.getString("CTL_FileInfoStatus_TreeConflict_Short");
} else if (match(status, FileInformation.STATUS_VERSIONED_CONFLICT)) {
return loc.getString("CTL_FileInfoStatus_Conflict_Short");
} else {
return ""; // NOI18N
}
}
示例4: createPopup
import org.openide.util.NbBundle; //导入方法依赖的package包/类
private JPopupMenu createPopup(int line) {
final ResourceBundle loc = NbBundle.getBundle(AnnotationBar.class);
final JPopupMenu popupMenu = new JPopupMenu();
VcsAnnotation annotation = getAnnotateLine(line);
if (annotation != null && vcsAnnotations != null) {
Action [] actions = vcsAnnotations.getActions(annotation);
for (Action action : actions) {
popupMenu.add(Utils.toMenuItem(action));
}
popupMenu.addSeparator();
}
JMenuItem menu = new JMenuItem(loc.getString("CTL_MenuItem_CloseAnnotations"));
menu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
hideBar();
}
});
popupMenu.add(menu);
return popupMenu;
}
示例5: AttachmentsPanel
import org.openide.util.NbBundle; //导入方法依赖的package包/类
public AttachmentsPanel(JComponent parentPanel) {
this.parentPanel = parentPanel;
this.supp = new ChangeSupport(this);
setBackground(UIManager.getColor("TextArea.background")); // NOI18N
ResourceBundle bundle = NbBundle.getBundle(AttachmentsPanel.class);
noneLabel = new JLabel(bundle.getString("AttachmentsPanel.noneLabel.text")); // NOI18N
createNewButton = new LinkButton(new CreateNewAction());
createNewButton.getAccessibleContext().setAccessibleDescription(bundle.getString("AttachmentPanels.createNewButton.AccessibleContext.accessibleDescription")); // NOI18N
try {
maxMethod = GroupLayout.Group.class.getDeclaredMethod("calculateMaximumSize", int.class); // NOI18N
maxMethod.setAccessible(true);
} catch (NoSuchMethodException nsmex) {
LOG.log(Level.INFO, nsmex.getMessage(), nsmex);
}
}
示例6: getReason
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
* Returns a human-readable representation of the reason. If the reason
* is a combination of multiple reasons, they are separated with
* {@code separ} except for the last reason, which is separated
* with {@code terminalSepar}
* <p>
* For example: getReason(", ", " or ") might return
* "abstract, package private or without testable methods".
*
* @return String
*/
public String getReason(String separ, String terminalSepar) {
try {
ResourceBundle bundle = NbBundle.getBundle(TestCreator.class);
if (reason == 0) {
return bundle.getString("TestabilityResult_OK"); //NOI18N
} else {
String str = ""; //NOI18N
boolean lastPrep = true;
for (long i = 0, r = reason; r > 0; r >>= 1, i++) {
if ((r & 1) != 0) {
if (str.length() > 0) {
if (lastPrep) {
str = terminalSepar + str;
lastPrep = false;
} else {
str = separ + str;
}
}
str = bundle.getString(reasonBundleKeys[(int)i]) + str;
}
}
return str;
}
} catch (MissingResourceException ex) {
ErrorManager.getDefault().notify(ex);
return "";
}
}
示例7: MacroDialogSupport
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Creates new MacroDialogSupport */
public MacroDialogSupport( Class kitClass ) {
this.kitClass = kitClass;
panel = new MacroSavePanel(kitClass);
ResourceBundle bundle = NbBundle.getBundle(MacroDialogSupport.class);
okButton = new JButton(bundle.getString("MDS_ok")); // NOI18N
cancelButton = new JButton(bundle.getString("MDS_cancel")); // NOI18N
okButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MDS_ok")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MDS_cancel")); // NOI18N
}
示例8: getPropSet
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
* Returns property sheet associated with node representing this source.
* TODO move it to the node?
* @return property sheet associated with node representing this source.
*/
public Sheet.Set getPropSet() {
Sheet.Set props = Sheet.createPropertiesSet();
final ResourceBundle bundle = NbBundle.getBundle(LogRecordsSource.class);
class RegexpFilterProp extends PropertySupport.ReadWrite {
//Pattern tempPat = Pattern.compile("");
public RegexpFilterProp() {
super("regexpFilterProp", Pattern.class,
bundle.getString("PROP_RegexpFilter"),
bundle.getString("HINT_RegexpFilter"));
}
public Object getValue() {
if (regexpFilter == null) {
return null;
} else {
return regexpFilter.pattern;
}
}
public void setValue(Object object) throws IllegalAccessException, IllegalArgumentException {
setRegexpFilterPatter((Pattern) object);
}
}
props.put(new RegexpFilterProp());
return props;
}
示例9: initAssistant
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
* Registers assistant messages related to DB column DnD.
*/
private void initAssistant() {
ResourceBundle bundle = NbBundle.getBundle(DBColumnDrop.class);
String dropBindingMsg = bundle.getString("MSG_ColumnDropBinding"); // NOI18N
String dropComponentMsg = bundle.getString("MSG_ColumnDropComponent"); // NOI18N
String tableWithoutPKMsg = bundle.getString("MSG_TableWithoutPK"); // NOI18N
String columnDefaultPackageMsg = bundle.getString("MSG_ColumnDefaultPackage"); // NOI18N
AssistantMessages messages = AssistantMessages.getDefault();
messages.setMessages("columnDropBinding", dropBindingMsg); // NOI18N
messages.setMessages("columnDropComponent", dropComponentMsg); // NOI18N
messages.setMessages("tableWithoutPK", tableWithoutPKMsg); // NOI18N
messages.setMessages("columnDefaultPackage", columnDefaultPackageMsg);
assistantInitialized = true;
}
示例10: CustomEditor
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Constructor. */
public CustomEditor(I18nString i18nString, Project project, FileObject file) {
super(i18nString.getSupport().getPropertyPanel(), false, project, file);
bundle = NbBundle.getBundle(FormI18nIntegerEditor.class);
setI18nString(i18nString);
env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
env.addVetoableChangeListener(this);
HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_FORMED);
}
示例11: LogTableModel
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Creates a new instance of LogTableModel */
public LogTableModel() {
ResourceBundle bundle = NbBundle.getBundle(LogViewerPane.class);
setColumnIdentifiers(new Object[]{bundle.getString("LBL_Time"), bundle.getString("LBL_Level"), bundle.getString("LBL_Message")});
}
示例12: FormI18nIntegerEditor
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Constructor. Creates new <code>ResourceBundleStringFormEditor</code>. */
public FormI18nIntegerEditor() {
bundle = NbBundle.getBundle(FormI18nIntegerEditor.class);
}
示例13: getLocString
import org.openide.util.NbBundle; //导入方法依赖的package包/类
static String getLocString (String s) {
if (bundle == null)
bundle = NbBundle.getBundle (ImportDebugger.class);
return bundle.getString (s);
}
示例14: create
import org.openide.util.NbBundle; //导入方法依赖的package包/类
static Category create(String categoryName, String bundleName, String displayNameKey, String descriptionKey) {
ResourceBundle bundle = NbBundle.getBundle(bundleName);
String displayName = bundle.getString(displayNameKey);
String description = bundle.getString(descriptionKey);
return new Category(categoryName, displayName, description);
}
示例15: actionString
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/**
* Workaround.
* I18N Test Wizard searches for keys in syncview package Bundle.properties
*/
private String actionString(String key) {
ResourceBundle actionsLoc = NbBundle.getBundle(MercurialAnnotator.class);
return actionsLoc.getString(key);
}