當前位置: 首頁>>代碼示例>>Java>>正文


Java UIManager.getString方法代碼示例

本文整理匯總了Java中javax.swing.UIManager.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java UIManager.getString方法的具體用法?Java UIManager.getString怎麽用?Java UIManager.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.UIManager的用法示例。


在下文中一共展示了UIManager.getString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: keyAcceleratorString

import javax.swing.UIManager; //導入方法依賴的package包/類
public static String keyAcceleratorString(KeyStroke keyStroke) {
    if (keyStroke == null || NO_KEYSTROKE.equals(keyStroke)) return null;
    
    String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode());
    
    int modifiers = keyStroke.getModifiers();
    if (modifiers == 0) return keyText;
    
    if (ACC_DELIMITER == null) {
        ACC_DELIMITER = UIManager.getString("MenuItem.acceleratorDelimiter"); // NOI18N
        if (ACC_DELIMITER == null) ACC_DELIMITER = "+"; // NOI18N // Note: NetBeans default, Swing uses '-' by default
    }
    
    return KeyEvent.getKeyModifiersText(modifiers) + ACC_DELIMITER + keyText;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:ActionsSupport.java

示例2: getCloseTabPressedImage

import javax.swing.UIManager; //導入方法依賴的package包/類
private static Icon getCloseTabPressedImage() {
    if( null == closeTabPressedImage ) {
        String path = UIManager.getString("nb.close.tab.icon.pressed.name" ); //NOI18N
        if( null != path ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == closeTabPressedImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_pressed.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_close_pressed.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_close_pressed.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_close_pressed.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_close_pressed.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_close_pressed.png", true); // NOI18N
        } else {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_close_pressed.png", true); // NOI18N
        }
    }
    return closeTabPressedImage;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CloseButtonFactory.java

示例3: getCloseTabRolloverImage

import javax.swing.UIManager; //導入方法依賴的package包/類
private static Icon getCloseTabRolloverImage() {
    if( null == closeTabMouseOverImage ) {
        String path = UIManager.getString("nb.close.tab.icon.rollover.name" ); //NOI18N
        if( null != path ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == closeTabMouseOverImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_rollover.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_close_rollover.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_close_rollover.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_close_rollover.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_close_rollover.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_close_rollover.png", true); // NOI18N
        } else {
            closeTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_close_rollover.png", true); // NOI18N
        }
    }
    return closeTabMouseOverImage;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CloseButtonFactory.java

示例4: getBigCloseTabImage

import javax.swing.UIManager; //導入方法依賴的package包/類
private static Icon getBigCloseTabImage() {
    if( null == bigCloseTabImage ) {
        String path = UIManager.getString("nb.bigclose.tab.icon.enabled.name" ); //NOI18N
        if( null != path ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == bigCloseTabImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_enabled.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_bigclose_enabled.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_bigclose_enabled.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_bigclose_enabled.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_bigclose_enabled.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_bigclose_enabled.png", true); // NOI18N
        } else {
            bigCloseTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_bigclose_enabled.png", true); // NOI18N
        }
    }
    return bigCloseTabImage;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CloseButtonFactory.java

示例5: getBigCloseTabRolloverImage

import javax.swing.UIManager; //導入方法依賴的package包/類
private static Icon getBigCloseTabRolloverImage() {
    if( null == bigCloseTabMouseOverImage ) {
        String path = UIManager.getString("nb.bigclose.tab.icon.rollover.name" ); //NOI18N
        if( null != path ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == bigCloseTabMouseOverImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_rollover.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_bigclose_rollover.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_bigclose_rollover.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_bigclose_rollover.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_bigclose_rollover.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_bigclose_rollover.png", true); // NOI18N
        } else {
            bigCloseTabMouseOverImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_bigclose_rollover.png", true); // NOI18N
        }
    }
    return bigCloseTabMouseOverImage;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CloseButtonFactory.java

示例6: convert

import javax.swing.UIManager; //導入方法依賴的package包/類
private static Object convert(Locale locale, String key) {
    if (key.endsWith("Text")) { // NON-NLS: suffix for text message
        return UIManager.getString(key, locale);
    }
    if (key.endsWith("Size")) { // NON-NLS: suffix for dimension
        return UIManager.getDimension(key, locale);
    }
    if (key.endsWith("Color")) { // NON-NLS: suffix for color
        return UIManager.getColor(key, locale);
    }
    int value = SwingUtilities2.getUIDefaultsInt(key, locale, -1);
    return Integer.valueOf(value);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:Test6524757.java

示例7: getUndoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
@Override
public String getUndoPresentationName() {
    // The following code does an original code of: return this.canUndo() ? super.getUndoPresentationName() : "";
    if (canUndo()) {
        // UndoManager.getUndoPresentationName() follows
        if (inProgress) {
            if (canUndo()) {
                return editToBeUndone().getUndoPresentationName();
            } else {
                return UIManager.getString("AbstractUndoableEdit.undoText");
            }
        } else {
            UndoableEdit last = lastEdit();
            if (last != null) {
                return last.getUndoPresentationName();
            } else {
                String name = getPresentationName();
                if (!"".equals(name)) {
                    name = UIManager.getString("AbstractUndoableEdit.undoText")
                            + " " + name;
                } else {
                    name = UIManager.getString("AbstractUndoableEdit.undoText");
                }
                return name;
            }
        }
    } else {
        return "";
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:31,代碼來源:UndoRedo.java

示例8: getPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Provides a localized, human readable description of this edit
 * suitable for use in, say, a change log.
 *
 * @return the description
 */
public String getPresentationName() {
    DocumentEvent.EventType type = getType();
    if(type == DocumentEvent.EventType.INSERT)
        return UIManager.getString("AbstractDocument.additionText");
    if(type == DocumentEvent.EventType.REMOVE)
        return UIManager.getString("AbstractDocument.deletionText");
    return UIManager.getString("AbstractDocument.styleChangeText");
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:15,代碼來源:AbstractDocument.java

示例9: getText

import javax.swing.UIManager; //導入方法依賴的package包/類
final String getText(Component component, String suffix) {
    return UIManager.getString(this.prefix + suffix + "Text", component.getLocale()); // NON-NLS: default postfix
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:4,代碼來源:ColorModel.java

示例10: getDefaultSwingText

import javax.swing.UIManager; //導入方法依賴的package包/類
private String getDefaultSwingText() {
    return doUndo ? UIManager.getString("AbstractUndoableEdit.undoText") : //NOI18N
        UIManager.getString("AbstractUndoableEdit.redoText"); //NOI18N
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:UndoRedoAction.java

示例11: getRedoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Returns a description of the redoable form of this edit.
 * If <code>end</code> has been invoked this calls into super.
 * Otherwise if there are edits to be redone, this returns
 * the value from the next significant edit that will be redone.
 * If there are no edits to be redone and <code>end</code> has not
 * been invoked this returns the value from the <code>UIManager</code>
 * property "AbstractUndoableEdit.redoText".
 *
 * @return a description of the redoable form of this edit
 * @see     #redo
 * @see     CompoundEdit#getRedoPresentationName
 */
public synchronized String getRedoPresentationName() {
    if (inProgress) {
        if (canRedo()) {
            return editToBeRedone().getRedoPresentationName();
        } else {
            return UIManager.getString("AbstractUndoableEdit.redoText");
        }
    } else {
        return super.getRedoPresentationName();
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:25,代碼來源:UndoManager.java

示例12: getRedoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Retreives the value from the defaults table with key
 * <code>AbstractUndoableEdit.redoText</code> and returns
 * that value followed by a space, followed by
 * <code>getPresentationName</code>.
 * If <code>getPresentationName</code> returns "",
 * then the defaults value is returned alone.
 *
 * @return the value from the defaults table with key
 *    <code>AbstractUndoableEdit.redoText</code>, followed
 *    by a space, followed by <code>getPresentationName</code>
 *    unless <code>getPresentationName</code> is "" in which
 *    case, the defaults value is returned alone.
 * @see #getPresentationName
 */
public String getRedoPresentationName() {
    String name = getPresentationName();
    if (!"".equals(name)) {
        name = UIManager.getString("AbstractUndoableEdit.redoText") +
            " " + name;
    } else {
        name = UIManager.getString("AbstractUndoableEdit.redoText");
    }

    return name;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:27,代碼來源:AbstractUndoableEdit.java

示例13: getUndoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Retreives the value from the defaults table with key
 * <code>AbstractUndoableEdit.undoText</code> and returns
 * that value followed by a space, followed by
 * <code>getPresentationName</code>.
 * If <code>getPresentationName</code> returns "",
 * then the defaults value is returned alone.
 *
 * @return the value from the defaults table with key
 *    <code>AbstractUndoableEdit.undoText</code>, followed
 *    by a space, followed by <code>getPresentationName</code>
 *    unless <code>getPresentationName</code> is "" in which
 *    case, the defaults value is returned alone.
 * @see #getPresentationName
 */
public String getUndoPresentationName() {
    String name = getPresentationName();
    if (!"".equals(name)) {
        name = UIManager.getString("AbstractUndoableEdit.undoText") +
            " " + name;
    } else {
        name = UIManager.getString("AbstractUndoableEdit.undoText");
    }

    return name;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:27,代碼來源:AbstractUndoableEdit.java

示例14: getUndoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Returns a description of the undoable form of this edit.
 * If <code>end</code> has been invoked this calls into super.
 * Otherwise if there are edits to be undone, this returns
 * the value from the next significant edit that will be undone.
 * If there are no edits to be undone and <code>end</code> has not
 * been invoked this returns the value from the <code>UIManager</code>
 * property "AbstractUndoableEdit.undoText".
 *
 * @return a description of the undoable form of this edit
 * @see     #undo
 * @see     CompoundEdit#getUndoPresentationName
 */
public synchronized String getUndoPresentationName() {
    if (inProgress) {
        if (canUndo()) {
            return editToBeUndone().getUndoPresentationName();
        } else {
            return UIManager.getString("AbstractUndoableEdit.undoText");
        }
    } else {
        return super.getUndoPresentationName();
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:25,代碼來源:UndoManager.java

示例15: getRedoPresentationName

import javax.swing.UIManager; //導入方法依賴的package包/類
/**
 * Provides a localized, human readable description of the redoable
 * form of this edit, e.g. for use as a Redo menu item. Typically
 * derived from getPresentationName();
 *
 * @return the description
 */
public String getRedoPresentationName() {
    return UIManager.getString("AbstractDocument.redoText") + " " +
        getPresentationName();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:AbstractDocument.java


注:本文中的javax.swing.UIManager.getString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。