List of usage examples for com.google.gwt.i18n.client Dictionary getDictionary
public static Dictionary getDictionary(String name)
Dictionary object associated with the given name. From source file:at.ait.dme.yuma.client.Application.java
License:EUPL
/** * returns a request parameter. the initial request parameters provided to the * entry point are stored as javascript variables and are therefore accessible * through the dictionary. see also annotate.jsp. * /*from ww w . ja v a 2 s.c o m*/ * @param parameterName * @return parameter value */ private static String getRequestParameterValue(String parameterName) { String parameterValue; try { Dictionary parameters = Dictionary.getDictionary("parameters"); parameterValue = parameters.get(parameterName); if (parameterValue.equals("null")) parameterValue = null; } catch (Exception e) { return null; } return parameterValue; }
From source file:at.ait.dme.yuma.suite.apps.core.client.YUMACoreProperties.java
License:EUPL
private static String getValue(String key) { String value;/* ww w . j a v a 2 s. c o m*/ try { Dictionary params = Dictionary.getDictionary("parameters"); value = params.get(key); if (value.equals("null")) value = null; } catch (Exception e) { return null; } return value; }
From source file:au.com.uptick.serendipity.client.MultiPageEntryPoint.java
License:Open Source License
private void onModuleLoad2() { try {/*from w w w.j a v a 2 s . c o m*/ if (!Log.isLoggingEnabled()) { Window.alert("Logging is disabled."); } // Use a code guard e.g. "if (Log.isDebugEnabled() {...}" // to ensure unnecessary code is complied out when log_level=OFF // or any log_level higher than DEBUG if (Log.isDebugEnabled()) { startTimeMillis = System.currentTimeMillis(); } // No code guard necessary as the code will be // complied out when log_level=OFF Log.debug("onModuleLoad2()"); // inject global styles GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected(); // load constants constants = (SerendipityConstants) GWT.create(SerendipityConstants.class); // load messages messages = (SerendipityMessages) GWT.create(SerendipityMessages.class); // this is required by gwt-platform proxy's generator DelayedBindRegistry.bind(ginjector); // get Host Page name Dictionary dictionary = Dictionary.getDictionary("Pages"); revealCurrentPlace(dictionary.get("page")); // hide the animated 'loading.gif' RootPanel.get("loading").setVisible(false); // Use a code guard e.g. "if (Log.isDebugEnabled() {...}" // to ensure unnecessary code is complied out when log_level=OFF // or any log_level higher than DEBUG if (Log.isDebugEnabled()) { long endTimeMillis = System.currentTimeMillis(); float durationSeconds = (endTimeMillis - startTimeMillis) / 1000F; Log.debug("Duration: " + durationSeconds + " seconds"); } } catch (Exception e) { Log.error("e: " + e); e.printStackTrace(); Window.alert(e.getMessage()); } }
From source file:br.com.pegasus.solutions.smartgwt.lib.client.rpc.impl.GenericGwtRpcDataSource.java
License:Apache License
private void showErrorMsg(final DSResponse response, Throwable e) { if ("session_expired".equals(e.getMessage())) { MessageUtil.showError(Dictionary.getDictionary("Application_" + LocaleUtil.CURRENT_LOCALE) .get("session_expired_login_again"), sessionTimeOutCallback); } else {//from ww w.ja v a 2s . c o m response.setStatus(RPCResponse.STATUS_FAILURE); response.setAttribute("data", e.getMessage()); } }
From source file:br.com.pegasus.solutions.smartgwt.lib.client.upload.FileUploader.java
License:Apache License
private void buildUploadButton() { if (this.uploadButton == null) { this.uploadButton = new ToolStripButton(this.submitBtnName, this.iconSubmitBtn); this.uploadButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { initialStateProgressBar(); if (iSubmitAction != null) { iSubmitAction.onClick(null); } else { if (StringUtil.isEmpty(getFileName())) { MessageUtil.showMsg(Dictionary.getDictionary("Application_" + LocaleUtil.CURRENT_LOCALE) .get("no_file_specified")); return; }/*www .ja v a 2 s . c o m*/ progressbar.setPercentDone(20); uploadButton.setDisabled(true); submit(); } } }); } }
From source file:br.com.pegasus.solutions.smartgwt.lib.client.view.impl.advanced.bar.OptionsToolBar.java
License:Apache License
public OptionsToolBar(LinkedHashMap<String, Boolean> optionsToNotShow, List<ToolStripButton> extraButtons) { setWidth100();//from w w w.j av a 2 s. co m setTop(0); setMargin(2); this.dc = Dictionary.getDictionary("Application_" + LocaleUtil.CURRENT_LOCALE); addSpacer(new ToolStripSpacer(4)); addButtons(optionsToNotShow, extraButtons); }
From source file:br.com.pegasus.solutions.smartgwt.lib.client.view.impl.advanced.bar.OptionsToolBar.java
License:Apache License
public OptionsToolBar(LinkedHashMap<String, Boolean> optionsToNotShow) { setWidth100();// ww w .ja v a2 s . co m setTop(0); setMargin(2); this.dc = Dictionary.getDictionary("Application_" + LocaleUtil.CURRENT_LOCALE); addSpacer(new ToolStripSpacer(4)); addButtons(optionsToNotShow, null); }
From source file:br.com.pegasus.solutions.smartgwt.lib.client.view.impl.util.ValidatorUtil.java
License:Apache License
/** * get mail validator//from w w w .j a v a2 s . c o m * * @return {@link Validator} */ public static Validator getMailValidator() { Dictionary dc = Dictionary.getDictionary("Application_" + LocaleUtil.CURRENT_LOCALE); RegExpValidator emailValidator = new RegExpValidator(); emailValidator.setExpression("^([a-zA-Z0-9_.\\-+])+@(([a-zA-Z0-9\\-])+\\.)+[a-zA-Z0-9]{2,4}$"); emailValidator.setErrorMessage(StringUtil.replaceHtmlSpecialCharsSequence(dc.get("invalid_email_address"))); return emailValidator; }
From source file:ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DictonaryBasedMessageProvider.java
License:Apache License
public DictonaryBasedMessageProvider(final String dictionaryName) { this.dictionaryName = dictionaryName; this.dictionary = Dictionary.getDictionary(dictionaryName); }
From source file:co.edu.udea.iw.rtf.client.Solicitudes.java
License:Open Source License
@SuppressWarnings("deprecation") public void onModuleLoad() { Dictionary var = Dictionary.getDictionary("userInSession"); UsuarioSingleton.setUpFromDictionary(var); // Create ClientFactory using deferred binding so we can replace with // different impls in gwt.xml ClientFactory clientFactory = GWT.create(ClientFactory.class); EventBus eventBus = clientFactory.getEventBus(); PlaceController placeController = clientFactory.getPlaceController(); // Start ActivityManager for the main widget with our ActivityMapper ActivityMapper activityMapper = new AppActivityMapper(clientFactory); ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); activityManager.setDisplay(appWidget); // Start PlaceHistoryHandler with our PlaceHistoryMapper AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, solicitudesPlace); historyHandler.register(placeController, eventBus, loginPlace); historyHandler.register(placeController, eventBus, asignarSolicitudPlace); historyHandler.register(placeController, eventBus, crearSolicitudPlace); if (UsuarioSingleton.getInstance().getLogin() != null) { historyHandler.register(placeController, eventBus, mainPagePlace); }//w ww. j av a2 s. c o m RootPanel.get().add(appWidget); historyHandler.handleCurrentHistory(); }