当前位置: 首页>>代码示例>>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;未经允许,请勿转载。