Refine search
/** * Finds a localized and/or branded string in a bundle. * @param clazz the class to use to locate the bundle (see {@link #getBundle(Class)} for details) * @param resName name of the resource to look for * @return the string associated with the resource * @throws MissingResourceException if either the bundle or the string cannot be found */ public static String getMessage(Class<?> clazz, String resName) throws MissingResourceException { return getBundle(clazz).getString(resName); }
private final String annotateName(FileObject fo) { String bundleName = (String) fo.getAttribute("SystemFileSystem.localizingBundle"); // NOI18N if (bundleName != null) { try { bundleName = Utilities.translate(bundleName); ResourceBundle b = NbBundle.getBundle(bundleName); try { return b.getString(fo.getPath()); } catch (MissingResourceException ex) { // ignore--normal } } catch (MissingResourceException ex) { Exceptions.attachMessage(ex, warningMessage(bundleName, fo)); LOG.log(Level.INFO, null, ex); // ignore } } return (String) fo.getAttribute("displayName"); // NOI18N }
/** Set new option alignment. See aligment constants for * possible values. * Fires property change event if successful. * * @param optionsAlign new options alignment * @throws IllegalArgumentException when unknown alignment is given * @see #DEFAULT_ALIGN */ public void setOptionsAlign(final int optionsAlign) { if ((optionsAlign != BOTTOM_ALIGN) && (optionsAlign != RIGHT_ALIGN)) { throw new IllegalArgumentException( NbBundle.getBundle(DialogDescriptor.class).getString("EXC_OptionsAlign") ); } if (this.optionsAlign == optionsAlign) { return; } int oldValue = this.optionsAlign; this.optionsAlign = optionsAlign; firePropertyChange(PROP_OPTIONS_ALIGN, new Integer(oldValue), new Integer(optionsAlign)); }
public EmptySplitter(int width) { ResourceBundle bundle = NbBundle.getBundle(SplittedPanel.class); accessibleContext = null; this.width = width; getAccessibleContext().setAccessibleName(bundle.getString("ACS_SplittedPanel_EmptySplitter")); getAccessibleContext().setAccessibleName(bundle.getString("ACSD_SplittedPanel_EmptySplitter")); }
/** Initiating the drag */ public void dragGestureRecognized(DragGestureEvent dge) { // check allowed actions if ((dge.getDragAction() & DnDConstants.ACTION_MOVE) == 0) { return; } // prepare transferable and start the drag int index = comp.locationToIndex(dge.getDragOrigin()); // no index, then no dragging... if (index < 0) { return; } // System.out.println("Starting drag..."); // NOI18N // create our flavor for transferring the index myFlavor = new DataFlavor( String.class, NbBundle.getBundle(IndexedCustomizer.class).getString("IndexedFlavor") ); try { dge.startDrag(DragSource.DefaultMoveDrop, new IndexTransferable(myFlavor, index), this); // remember the gesture this.dge = dge; } catch (InvalidDnDOperationException exc) { Logger.getLogger(IndexedCustomizer.class.getName()).log(Level.WARNING, null, exc); // PENDING notify user - cannot start the drag } }
private void initAccessible() { if (nameFormat == null) { ResourceBundle bundle = NbBundle.getBundle(SplittedPanel.class); nameFormat = new MessageFormat(bundle.getString("ACS_SplittedPanel_Name")); ResourceBundle bundle = NbBundle.getBundle(SplittedPanel.class); descriptionFormat = new MessageFormat(bundle.getString("ACS_SplittedPanel_Description"));
popupMenu = new JPopupMenu(); java.util.ResourceBundle awtBundle = NbBundle.getBundle(SplittedPanel.class); popupMenu.add(verticalCMI = new JRadioButtonMenuItem(awtBundle.getString("SplittedPanelVertical"))); popupMenu.add(horizontalCMI = new JRadioButtonMenuItem(awtBundle.getString("SplittedPanelHorizontal"))); popupMenu.add(new JSeparator()); popupMenu.add(swapCMI = new JMenuItem(awtBundle.getString("SplittedPanelSwap"))); popupMenu.add(new JSeparator()); popupMenu.add(splitterCMI = new JMenuItem(awtBundle.getString("ResetSplitter")));
/** Finds a localized string in a bundle. * @param clazz the class to use to locate the bundle * @param resName name of the resource to look for * @return the string associated with the resource * @throws MissingResourceException if either the bundle or the string cannot be found */ public static String getMessage (Class clazz, String resName) throws MissingResourceException { return getBundle (clazz).getString(resName); }