Example usage for java.util ResourceBundle getBundle

List of usage examples for java.util ResourceBundle getBundle

Introduction

In this page you can find the example usage for java.util ResourceBundle getBundle.

Prototype

@CallerSensitive
public static final ResourceBundle getBundle(String baseName) 

Source Link

Document

Gets a resource bundle using the specified base name, the default locale, and the caller module.

Usage

From source file:com.microsoft.alm.plugin.idea.git.ui.branch.CreateBranchForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/*from w  ww .  j a  va 2s . c om*/
 */
private void $$$setupUI$$$() {
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1));
    nameLabel = new JLabel();
    this.$$$loadLabelText$$$(nameLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
            .getString("CreateBranchDialog.NameLabel"));
    contentPanel.add(nameLabel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    remoteBranchComboBox = new JComboBox();
    contentPanel.add(remoteBranchComboBox,
            new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    nameTextField = new JTextField();
    contentPanel.add(nameTextField,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(150, -1), null, 0, false));
    basedOn = new JLabel();
    this.$$$loadLabelText$$$(basedOn, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
            .getString("CreateBranchDialog.BasedOn"));
    contentPanel.add(basedOn,
            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    checkoutBranch = new JCheckBox();
    checkoutBranch.setSelected(true);
    this.$$$loadButtonText$$$(checkoutBranch,
            ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
                    .getString("CreateBranchDialog.CheckoutBranch"));
    contentPanel.add(checkoutBranch,
            new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}

From source file:com.dimdim.conference.application.portal.PortalServerAdapter.java

private PortalServerAdapter() {
    this.httpClient = new HttpClient();
    try {/*from  w w w.  j  a  v a  2  s .c  om*/
        ResourceBundle rb = ResourceBundle.getBundle("resources.portal");
        try {
            String s = rb.getString("MakeCallbacksForAllMeetings");
            MakeCallbacksForAllMeetings = Boolean.parseBoolean(s);
        } catch (Exception e) {
            MakeCallbacksForAllMeetings = false;
        }
        portalServerHost = rb.getString("PortalServerHost");
        portalServerPortNumber = rb.getString("PortalServerPortNumber");
        portalServerSecurePortNumber = rb.getString("PortalServerSecurePortNumber");
        portalServerWebappName = rb.getString("PortalServerWebappName");

        portalServerInternalHost = rb.getString("PortalServerInternalHost");
        portalServerInternalPortNumber = rb.getString("PortalServerInternalPortNumber");
        portalServerInternalSecurePortNumber = rb.getString("PortalServerInternalSecurePortNumber");

        String baseUrl = "http://" + this.portalServerInternalHost + ":" + this.portalServerInternalPortNumber
                + "/" + this.portalServerWebappName + "/";
        this.meetingStartedUrl = baseUrl + getActionName(rb, "MeetingStartedAction", "MeetingStarted.action");
        this.meetingClosedUrl = baseUrl + getActionName(rb, "MeetingClosedAction", "MeetingClosed.action");
        this.nonPortalMeetingClosedUrl = baseUrl
                + getActionName(rb, "NonPortalMeetingClosedAction", "NonPortalMeetingClosed.action");
        this.userJoinedUrl = baseUrl + getActionName(rb, "UserJoinedAction", "UserJoined.action");
        this.userLeftUrl = baseUrl + getActionName(rb, "UserLeftAction", "UserLeft.action");
        this.consoleLoadedUrl = baseUrl + getActionName(rb, "ConsoleLoadedAction", "ConsoleLoaded.action");

        urlQueue = new Vector();
        TimerService.getService().addUser(this);
    } catch (Exception e) {
        //         e.printStackTrace();
    }
}

From source file:JAXRSaveClassificationScheme.java

/**
     * Establishes a connection to a registry.
     */*from  ww w . j ava 2 s .co m*/
     * @param queryUrl        the URL of the query registry
     * @param publishUrl        the URL of the publish registry
     */
    public void makeConnection(String queryUrl, String publishUrl) {
        /*
         * Specify proxy information in case you
         *  are going beyond your firewall.
         */
        ResourceBundle bundle = ResourceBundle.getBundle("JAXRExamples");
        String httpProxyHost = bundle.getString("http.proxyHost");
        String httpProxyPort = bundle.getString("http.proxyPort");
        String httpsProxyHost = bundle.getString("https.proxyHost");
        String httpsProxyPort = bundle.getString("https.proxyPort");

        /*
         * Define connection configuration properties.
         * To delete, you need both the query URL and the
         * publish URL.
         */
        Properties props = new Properties();
        props.setProperty("javax.xml.registry.queryManagerURL", queryUrl);
        props.setProperty("javax.xml.registry.lifeCycleManagerURL", publishUrl);
        props.setProperty("com.sun.xml.registry.http.proxyHost", httpProxyHost);
        props.setProperty("com.sun.xml.registry.http.proxyPort", httpProxyPort);
        props.setProperty("com.sun.xml.registry.https.proxyHost", httpsProxyHost);
        props.setProperty("com.sun.xml.registry.https.proxyPort", httpsProxyPort);

        try {
            // Create the connection, passing it the 
            // configuration properties
            ConnectionFactory factory = ConnectionFactory.newInstance();
            factory.setProperties(props);
            connection = factory.createConnection();
            System.out.println("Created connection to registry");
        } catch (Exception e) {
            e.printStackTrace();

            if (connection != null) {
                try {
                    connection.close();
                } catch (JAXRException je) {
                }
            }
        }
    }

From source file:de.uni_koeln.spinfo.maalr.webapp.controller.WebMVCController.java

private String getLocalizedString(String key, HttpSession session, HttpServletRequest request) {
    String locale = getLocale(session, request);
    if (locale == null) {
        return ResourceBundle.getBundle("de.uni_koeln.spinfo.maalr.webapp.i18n.text").getString(key);
    } else {/*  w ww.  j  a  va  2s  .  co m*/
        return ResourceBundle.getBundle("de.uni_koeln.spinfo.maalr.webapp.i18n.text", new Locale(locale))
                .getString(key);
    }
}

From source file:JAXRQueryByNAICSClassification.java

/**
     * Establishes a connection to a registry.
     */*from ww w  .j  a v  a  2 s .co m*/
     * @param queryUrl        the URL of the query registry
     * @param publishUrl        the URL of the publish registry
     */
    public void makeConnection(String queryUrl, String publishUrl) {
        /*
         * Specify proxy information in case you
         *  are going beyond your firewall.
         */
        ResourceBundle bundle = ResourceBundle.getBundle("JAXRExamples");
        String httpProxyHost = bundle.getString("http.proxyHost");
        String httpProxyPort = bundle.getString("http.proxyPort");
        String httpsProxyHost = bundle.getString("https.proxyHost");
        String httpsProxyPort = bundle.getString("https.proxyPort");

        /*
         * Define connection configuration properties.
         * For simple queries, you need the query URL.
         * To use a life cycle manager, you need the publish URL.
         */
        Properties props = new Properties();
        props.setProperty("javax.xml.registry.queryManagerURL", queryUrl);
        props.setProperty("javax.xml.registry.lifeCycleManagerURL", publishUrl);

        props.setProperty("com.sun.xml.registry.http.proxyHost", httpProxyHost);
        props.setProperty("com.sun.xml.registry.http.proxyPort", httpProxyPort);
        props.setProperty("com.sun.xml.registry.https.proxyHost", httpsProxyHost);
        props.setProperty("com.sun.xml.registry.https.proxyPort", httpsProxyPort);

        try {
            // Create the connection, passing it the 
            // configuration properties
            ConnectionFactory factory = ConnectionFactory.newInstance();
            factory.setProperties(props);
            connection = factory.createConnection();
            System.out.println("Created connection to registry");
        } catch (Exception e) {
            e.printStackTrace();

            if (connection != null) {
                try {
                    connection.close();
                } catch (JAXRException je) {
                }
            }
        }
    }

From source file:com.cburch.logisim.util.LocaleManager.java

private void loadDefault() {
    if (settings == null) {
        try {// w  w  w .ja v  a  2 s.  c  o m
            settings = ResourceBundle.getBundle(dir_name + "/" + SETTINGS_NAME);
        } catch (java.util.MissingResourceException e) {
        }
    }

    try {
        loadLocale(Locale.getDefault());
        if (locale != null)
            return;
    } catch (java.util.MissingResourceException e) {
    }
    try {
        loadLocale(Locale.ENGLISH);
        if (locale != null)
            return;
    } catch (java.util.MissingResourceException e) {
    }
    Locale[] choices = getLocaleOptions();
    if (choices != null && choices.length > 0)
        loadLocale(choices[0]);
    if (locale != null)
        return;
    throw new RuntimeException("No locale bundles are available");
}

From source file:JAXRQuery.java

/**
     * Establishes a connection to a registry.
     */*  w w  w . ja v  a2  s  .com*/
     * @param queryUrl        the URL of the query registry
     * @param publishUrl        the URL of the publish registry
     */
    public void makeConnection(String queryUrl, String publishUrl) {
        /*
         * Specify proxy information in case you
         *  are going beyond your firewall.
         */
        ResourceBundle registryBundle = ResourceBundle.getBundle("JAXRExamples");
        String httpProxyHost = registryBundle.getString("http.proxyHost");
        String httpProxyPort = registryBundle.getString("http.proxyPort");

        /*
         * Define connection configuration properties.
         * For simple queries, you need the query URL.
         */
        Properties props = new Properties();
        props.setProperty("javax.xml.registry.queryManagerURL", queryUrl);
        props.setProperty("com.sun.xml.registry.http.proxyHost", httpProxyHost);
        props.setProperty("com.sun.xml.registry.http.proxyPort", httpProxyPort);

        try {
            // Create the connection, passing it the 
            // configuration properties
            ConnectionFactory factory = ConnectionFactory.newInstance();
            factory.setProperties(props);
            connection = factory.createConnection();
            System.out.println("Created connection to registry");
        } catch (Exception e) {
            e.printStackTrace();

            if (connection != null) {
                try {
                    connection.close();
                } catch (JAXRException je) {
                }
            }
        }
    }

From source file:it.infn.ct.security.utilities.LDAPUtils.java

public static boolean isMailUsed(String mail) {
    boolean registered = false;
    NamingEnumeration results = null;
    DirContext ctx = null;//from w w w .j  a  v  a  2s. c  o m
    try {
        ctx = getContext();
        SearchControls controls = new SearchControls();
        controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
        ResourceBundle rb = ResourceBundle.getBundle("ldap");

        results = ctx.search(rb.getString("peopleRoot"), "(mail=" + mail + ")", controls);
        if (results.hasMore()) {
            registered = true;
        }
    } catch (NameNotFoundException ex) {
        _log.error(ex);
    } catch (NamingException e) {
        registered = true;
    } finally {
        if (results != null) {
            try {
                results.close();
            } catch (Exception e) {
                // Never mind this.
            }
        }
        if (ctx != null) {
            try {
                ctx.close();
            } catch (Exception e) {
                // Never mind this.
            }
        }
    }
    return registered;
}

From source file:JAXRQueryByWSDLClassification.java

/**
     * Establishes a connection to a registry.
     */*from  ww w .j  a  v a 2s . c  o  m*/
     * @param queryUrl        the URL of the query registry
     * @param publishUrl        the URL of the publish registry
     */
    public void makeConnection(String queryUrl, String publishUrl) {
        /*
         * Specify proxy information in case you
         *  are going beyond your firewall.
         */
        ResourceBundle bundle = ResourceBundle.getBundle("JAXRExamples");
        String httpProxyHost = bundle.getString("http.proxyHost");
        String httpProxyPort = bundle.getString("http.proxyPort");
        String httpsProxyHost = bundle.getString("https.proxyHost");
        String httpsProxyPort = bundle.getString("https.proxyPort");

        /*
         * Define connection configuration properties.
         * For simple queries, you need the query URL.
         * To use a life cycle manager, you need the publish URL.
         */
        Properties props = new Properties();
        props.setProperty("javax.xml.registry.queryManagerURL", queryUrl);
        props.setProperty("javax.xml.registry.lifeCycleManagerURL", publishUrl);
        props.setProperty("com.sun.xml.registry.http.proxyHost", httpProxyHost);
        props.setProperty("com.sun.xml.registry.http.proxyPort", httpProxyPort);
        props.setProperty("com.sun.xml.registry.https.proxyHost", httpsProxyHost);
        props.setProperty("com.sun.xml.registry.https.proxyPort", httpsProxyPort);

        try {
            // Create the connection, passing it the 
            // configuration properties
            ConnectionFactory factory = ConnectionFactory.newInstance();
            factory.setProperties(props);
            connection = factory.createConnection();
            System.out.println("Created connection to registry");
        } catch (Exception e) {
            e.printStackTrace();

            if (connection != null) {
                try {
                    connection.close();
                } catch (JAXRException je) {
                }
            }
        }
    }

From source file:com.puppycrawl.tools.checkstyle.utils.TokenUtils.java

/**
 * Returns the short description of a token for a given name.
 * @param name the name of the token ID to get
 * @return a short description/*from w ww  .  j  av  a 2s .  co  m*/
 */
public static String getShortDescription(String name) {
    if (!TOKEN_NAME_TO_VALUE.containsKey(name)) {
        throw new IllegalArgumentException(TOKEN_NAME_EXCEPTION_PREFIX + name);
    }

    final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes";
    final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes);
    return bundle.getString(name);
}