java.awt.Toolkit#getProperty ( )源码实例Demo

下面列出了java.awt.Toolkit#getProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: InputContext.java
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
源代码2 项目: dragonwell8_jdk   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码3 项目: hottub   文件: InputMethodPopupMenu.java
/**
 * Returns a localized locale name for input methods with the
 * given locale. It falls back to Locale.getDisplayName() and
 * then to Locale.toString() if no localized locale name is found.
 *
 * @param locale Locale for which localized locale name is obtained
 */
String getLocaleName(Locale locale) {
    String localeString = locale.toString();
    String localeName = Toolkit.getProperty("AWT.InputMethodLanguage." + localeString, null);
    if (localeName == null) {
        localeName = locale.getDisplayName();
        if (localeName == null || localeName.length() == 0)
            localeName = localeString;
    }
    return localeName;
}
 
源代码4 项目: jdk8u-dev-jdk   文件: WInputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
@Override
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码5 项目: dragonwell8_jdk   文件: WInputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
@Override
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码6 项目: jdk8u-jdk   文件: InputContext.java
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
源代码7 项目: jdk8u_jdk   文件: WInputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
@Override
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码8 项目: openjdk-jdk9   文件: WInputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
@Override
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码9 项目: TencentKona-8   文件: InputContext.java
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
源代码10 项目: hottub   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: InputContext.java
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
源代码12 项目: hottub   文件: X11InputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码13 项目: jdk8u60   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
@Override
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码15 项目: Bytecoder   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码16 项目: jdk8u60   文件: X11InputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码17 项目: jdk8u_jdk   文件: X11InputMethodDescriptor.java
/**
 * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
 */
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
    // We ignore the input locale.
    // When displaying for the default locale, rely on the localized AWT properties;
    // for any other locale, fall back to English.
    String name = "System Input Methods";
    if (Locale.getDefault().equals(displayLanguage)) {
        name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
    }
    return name;
}
 
源代码18 项目: openjdk-8   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码19 项目: jdk8u_jdk   文件: ExecutableInputMethodManager.java
synchronized void initialize() {
    selectInputMethodMenuTitle = Toolkit.getProperty("AWT.InputMethodSelectionMenu", "Select Input Method");

    triggerMenuString = selectInputMethodMenuTitle;
}
 
synchronized void initialize() {
    selectInputMethodMenuTitle = Toolkit.getProperty("AWT.InputMethodSelectionMenu", "Select Input Method");

    triggerMenuString = selectInputMethodMenuTitle;
}