Search in sources :

Example 81 with ResourceBundle

use of java.util.ResourceBundle in project kotlin by JetBrains.

the class KotlinRefactoringBundle method getBundle.

private static ResourceBundle getBundle() {
    ResourceBundle bundle = null;
    if (ourBundle != null)
        bundle = ourBundle.get();
    if (bundle == null) {
        bundle = ResourceBundle.getBundle(BUNDLE);
        ourBundle = new SoftReference<ResourceBundle>(bundle);
    }
    return bundle;
}
Also used : ResourceBundle(java.util.ResourceBundle)

Example 82 with ResourceBundle

use of java.util.ResourceBundle in project Asqatasun by Asqatasun.

the class ElementColumnBuilderImpl method getElementColumn.

@Override
public AbstractColumn getElementColumn(Locale locale) {
    ColumnBuilder columnBuilder = ColumnBuilder.getNew();
    columnBuilder.setWidth(columnWidth);
    if (propertyName != null && valueClassName != null) {
        columnBuilder.setColumnProperty(propertyName, valueClassName);
    }
    if (customExpressionBuilder != null) {
        columnBuilder.setCustomExpression(customExpressionBuilder.build(locale));
    }
    if (style != null) {
        columnBuilder.setStyle(style);
    }
    if (headerStyle != null) {
        columnBuilder.setHeaderStyle(headerStyle);
    }
    if (columnTitleBundleName != null) {
        ResourceBundle bundle = ResourceBundle.getBundle(columnTitleBundleName, locale);
        if (columnTitleKey != null) {
            columnBuilder.setTitle(StringEscapeUtils.unescapeHtml4(bundle.getString(columnTitleKey)));
        }
    }
    if (conditionalStyleBuilderList != null && !conditionalStyleBuilderList.isEmpty()) {
        columnBuilder.addConditionalStyles(buildConditionStyleList(locale));
    }
    AbstractColumn elementColumn = null;
    try {
        elementColumn = columnBuilder.build();
    } catch (ColumnBuilderException ex) {
        LOGGER.error(ex);
    }
    return elementColumn;
}
Also used : ColumnBuilderException(ar.com.fdvs.dj.domain.builders.ColumnBuilderException) ResourceBundle(java.util.ResourceBundle) ColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder) AbstractColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn)

Example 83 with ResourceBundle

use of java.util.ResourceBundle in project Asqatasun by Asqatasun.

the class PageListWrapper method getUrlWithPageResultLinkAndExternalLink.

/**
     * Decoration of the displayed raw mark to add the appropriate grade css
     * class.
     *
     * @return
     */
public String getUrlWithPageResultLinkAndExternalLink() {
    Object lObject = this.getCurrentRowObject();
    ResourceBundle resourceBundle = getResourceBundle(this.getPageContext().getRequest());
    PageResult pageResult = null;
    if (lObject instanceof PageResult) {
        pageResult = ((PageResult) lObject);
    }
    StringBuilder strb = new StringBuilder();
    strb.append(buildExternalLinkUrl(pageResult != null ? pageResult.getUrl() : null, resourceBundle));
    strb.append(getUrlLink(pageResult, resourceBundle));
    return strb.toString();
}
Also used : ResourceBundle(java.util.ResourceBundle) PageResult(org.asqatasun.webapp.presentation.data.PageResult)

Example 84 with ResourceBundle

use of java.util.ResourceBundle in project Asqatasun by Asqatasun.

the class SiteKrashTest method initialize.

/**
     *
     */
private void initialize() {
    // These parameters has to passed as JVM argument
    System.out.println(contractId);
    contractIds = Arrays.asList(contractId.split("-"));
    ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_NAME);
    formUrl = hostLocation + bundle.getString(FORM_URL_KEY);
}
Also used : ResourceBundle(java.util.ResourceBundle)

Example 85 with ResourceBundle

use of java.util.ResourceBundle in project Asqatasun by Asqatasun.

the class AbstractWebDriverTestClass method initialize.

/**
     *
     */
private void initialize() {
    // Mysql access parameters are passed as JVM argument
    //        dbUrl = System.getProperty(DB_URL_KEY);
    //        dbName = System.getProperty(DB_NAME_KEY);
    //        dbUser = System.getProperty(DB_USER_KEY);
    //        dbPassword = System.getProperty(DB_PASSWORD_KEY);
    //        initDb();
    // These parameters has to passed as JVM argument
    user = System.getProperty(USER_KEY);
    password = System.getProperty(PASSWORD_KEY);
    hostLocation = System.getProperty(HOST_LOCATION_KEY);
    xvfbDisplay = System.getProperty(XVFB_DISPLAY_KEY);
    pathToFirefox = System.getProperty(FIREFOX_PATH_KEY);
    //        createRootUserInDb();
    ResourceBundle parametersBundle = ResourceBundle.getBundle(BUNDLE_NAME);
    userFieldName = parametersBundle.getString(USER_FIELD_NAME_KEY);
    passwordFieldName = parametersBundle.getString(PASSWORD_FIELD_NAME_KEY);
    loginUrl = hostLocation + parametersBundle.getString(LOGIN_URL_KEY);
    logoutUrl = hostLocation + parametersBundle.getString(LOGOUT_URL_KEY);
    adminUrl = hostLocation + parametersBundle.getString(ADMIN_URL_KEY);
    addUserUrl = hostLocation + parametersBundle.getString(ADD_USER_URL_KEY);
    editUserUrl = hostLocation + parametersBundle.getString(EDIT_USER_URL_KEY);
    deleteUserUrl = hostLocation + parametersBundle.getString(DELETE_USER_URL_KEY);
    addContractUrl = hostLocation + parametersBundle.getString(ADD_CONTRACT_URL_KEY);
    contractUrl = hostLocation + parametersBundle.getString(CONTRACT_URL_KEY);
    auditPagesSetupUrl = hostLocation + parametersBundle.getString(AUDIT_PAGES_URL_KEY);
    auditSiteSetupUrl = hostLocation + parametersBundle.getString(AUDIT_SITE_URL_KEY);
    auditUploadSetupUrl = hostLocation + parametersBundle.getString(AUDIT_UPLOAD_URL_KEY);
    auditScenarioSetupUrl = hostLocation + parametersBundle.getString(AUDIT_SCENARIO_URL_KEY);
    addUserContractUrl = hostLocation + parametersBundle.getString(ADD_USER_CONTRACT_URL_KEY);
    editUserContractUrl = hostLocation + parametersBundle.getString(EDIT_USER_CONTRACT_URL_KEY);
    if (driver == null) {
        FirefoxBinary ffBinary = new FirefoxBinary(new File(pathToFirefox));
        if (xvfbDisplay != null) {
            Logger.getLogger(this.getClass()).info("Setting Xvfb display with value " + xvfbDisplay);
            ffBinary.setEnvironmentProperty("DISPLAY", xvfbDisplay);
        }
        driver = new FirefoxDriver(ffBinary, new FirefoxProfile());
    }
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) FirefoxBinary(org.openqa.selenium.firefox.FirefoxBinary) ResourceBundle(java.util.ResourceBundle) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile) File(java.io.File)

Aggregations

ResourceBundle (java.util.ResourceBundle)1189 Locale (java.util.Locale)180 MissingResourceException (java.util.MissingResourceException)150 Test (org.junit.Test)100 ArrayList (java.util.ArrayList)71 HashMap (java.util.HashMap)70 IOException (java.io.IOException)67 PropertyResourceBundle (java.util.PropertyResourceBundle)56 URL (java.net.URL)48 File (java.io.File)47 Map (java.util.Map)45 InputStream (java.io.InputStream)43 Enumeration (java.util.Enumeration)34 HashSet (java.util.HashSet)30 Test (org.junit.jupiter.api.Test)30 ActionMessage (org.apache.struts.action.ActionMessage)29 MessageFormat (java.text.MessageFormat)28 ListResourceBundle (java.util.ListResourceBundle)28 Set (java.util.Set)26 Preferences (java.util.prefs.Preferences)21