/** * Retrieves thelast selected repository. * * @return the last selected repsoitory, maybe <code>null</code>. */ public String getLastSelectedRepositoryDir() { return _properties.getPropertyString(CURRENT_REPSOITORY_KEY, null); }
/** * Gets a value of type <code>String</code>. * * @param key the key * * @return the value for the given key, or <code>""</code> (empty string) if the key is not contained in this * property set, never <code>null</code>. */ public String getPropertyString(String key) { return getPropertyString(key, ""); }
private File getInputProductDir() { final String path = applicationContext.getPreferences().getPropertyString(INPUT_PRODUCT_DIR_KEY); final File inputProductDir; if (path != null) { inputProductDir = new File(path); } else { inputProductDir = null; } return inputProductDir; }
@Override public void actionPerformed(ActionEvent e) { final boolean usingUrl = refresh(); if (usingUrl) { final String urls = propertyMap.getPropertyString(PROPERTY_KEY_SERVER_URLS); final String currentUrl = urlField.getSelectedItem().toString(); if (!urls.contains(currentUrl)) { propertyMap.setPropertyString(PROPERTY_KEY_SERVER_URLS, urls + "\n" + currentUrl); updateUrlField(); } } } });
private File getIODir() { File dir = SystemUtils.getUserHomeDir(); if (propertyMap != null) { dir = new File(propertyMap.getPropertyString(PROPERTY_KEY_IO_DIR, dir.getPath())); } return dir; }
private void applyCurrentDirectory(JFileChooser fileChooser) { if (appContext != null) { String homeDirPath = SystemUtils.getUserHomeDir().getPath(); String lastDir = appContext.getPreferences().getPropertyString(lastDirPreferenceKey, homeDirPath); fileChooser.setCurrentDirectory(new File(lastDir)); } }
private void updateUrlField() { final String urlsProperty = propertyMap.getPropertyString(PROPERTY_KEY_SERVER_URLS); final String[] urls = urlsProperty.split("\n"); for (String url : urls) { if (StringUtils.isNotNullAndNotEmpty(url) && !contains(urlField, url)) { urlField.addItem(url); } } }
private File getLastDirectory() { PropertyMap preferences = getContext().getAppContext().getPreferences(); String dirPath = preferences.getPropertyString(LAST_DIR, System.getProperty("user.home")); File lastDir = new File(dirPath); if (!lastDir.isDirectory()) { lastDir = new File(System.getProperty("user.home")); } return lastDir; }
protected File getIODir() { if (ioDir == null) { if (preferences != null) { ioDir = new File( preferences.getPropertyString(PREFERENCES_KEY_IO_DIR, getSystemAuxdataDir().getPath())); } else { ioDir = getSystemAuxdataDir(); } } return ioDir; }
public boolean mustCreateData(final RepositoryEntry entry, final Repository repository) { final PropertyMap propertyMap = repository.getPropertyMap(); final String productName = entry.getProductFile().getName(); for (final String propertyKey : PROPERTY_KEYS) { if (propertyMap.getPropertyString(productName + propertyKey, null) == null) { return true; } } return false; }
private File getLastDirectory() { PropertyMap preferences = getContext().getAppContext().getPreferences(); String dirPath = preferences.getPropertyString(PROPERTY_LAST_DIR, System.getProperty("user.home")); File lastDir = new File(dirPath); if (!lastDir.isDirectory()) { lastDir = new File(System.getProperty("user.home")); } return lastDir; } }
public void loadCodeHistory() { if (preferences != null) { history.clear(); for (int index = 0; index < CODE_HISTORY_MAX; index++) { final String code = preferences.getPropertyString(CODE_HISTORY_PREFERENCES_PREFIX + index); addToCodeHistory(code, false); } historyIndex = -1; updateUIState(); } }
private void clearRepositoryList() { for (int i = 0; i < _properties.getProperties().size(); i++) { final String propertyName = createRepositoryPropertyName(i); if (_properties.getPropertyString(propertyName) != "") { _properties.setPropertyString(propertyName, null); } } }
public Object getData(final RepositoryEntry entry, final Repository repository) throws IOException { final String productName = entry.getProductFile().getName(); final PropertyMap propertyMap = repository.getPropertyMap(); final PropertyMap properties = new PropertyMap(); for (final String propertyKey : PROPERTY_KEYS) { final String typeString = propertyMap.getPropertyString(productName + propertyKey, null); properties.setPropertyString(propertyKey, typeString); } return properties; }
private LayerType getWorldMapLayerType() { final VisatApp visatApp = VisatApp.getApp(); String layerTypeClassName = visatApp.getPreferences().getPropertyString(WORLDMAP_TYPE_PROPERTY_NAME, DEFAULT_LAYER_TYPE); return LayerTypeRegistry.getLayerType(layerTypeClassName); }
File getDirectory() { File directory = SystemUtils.getUserHomeDir(); if (VisatApp.getApp().getPreferences() != null) { directory = new File(VisatApp.getApp().getPreferences().getPropertyString("mask.io.dir", directory.getPath())); } return directory; } }
public static void transferConnectionData(PropertyMap propertyMap, ConnectionConfigData connectionConfigData) { ProxyConfig proxyConfig = new ProxyConfig(); connectionConfigData.setProxyConfig(proxyConfig); connectionConfigData.setRepositoryUrl(System.getProperty(SYS_KEY_BEAM_REPOSITORY_URL, "")); connectionConfigData.setProxyUsed(propertyMap.getPropertyBool(KEY_BEAM_REPOSITORY_PROXY_USED, false)); proxyConfig.setHost(propertyMap.getPropertyString(KEY_BEAM_REPOSITORY_PROXY_HOST)); proxyConfig.setPort(propertyMap.getPropertyInt(KEY_BEAM_REPOSITORY_PROXY_PORT)); proxyConfig.setAuthorizationUsed(propertyMap.getPropertyBool(KEY_BEAM_REPOSITORY_PROXY_AUTH_USED)); proxyConfig.setUsername(propertyMap.getPropertyString(KEY_BEAM_REPOSITORY_PROXY_USERNAME)); proxyConfig.setScrambledPassword(propertyMap.getPropertyString(KEY_BEAM_REPOSITORY_PROXY_PASSWORD)); } }
public Object getData(final RepositoryEntry entry, final Repository repository) throws IOException { final String productName = entry.getProductFile().getName(); final PropertyMap propertyMap = repository.getPropertyMap(); final String boundaryPathString = propertyMap.getPropertyString(productName + KEY_BOUNDARY_PATH, null); final Double latValue = propertyMap.getPropertyDouble(productName + KEY_PRODUCT_CENTER_LAT, null); final Double lonValue = propertyMap.getPropertyDouble(productName + KEY_PRODUCT_CENTER_LON, null); final PropertyMap dataMap = new PropertyMap(); dataMap.setPropertyString(KEY_BOUNDARY_PATH, boundaryPathString); dataMap.setPropertyDouble(KEY_PRODUCT_CENTER_LAT, latValue); dataMap.setPropertyDouble(KEY_PRODUCT_CENTER_LON, lonValue); return dataMap; }
@Override public void setConfigParamValues(PropertyMap propertyMap, ParamExceptionHandler errorHandler) { String lafClassName = propertyMap.getPropertyString(PROPERTY_KEY_APP_UI_LAF, getDefaultLafClassName()); getConfigParams().getParameter(PROPERTY_KEY_APP_UI_LAF_NAME).setValue(getLafName(lafClassName), errorHandler); super.setConfigParamValues(propertyMap, errorHandler); }
public void initBy(final PropertyMap propertyMap) { int maxNumEntries = propertyMap.getPropertyInt(getLengthKey(), getMaxNumEntries()); setMaxNumEntries(maxNumEntries); for (int i = maxNumEntries - 1; i >= 0; i--) { String entry = propertyMap.getPropertyString(getNumKey(i), null); if (entry != null && isValidItem(entry)) { push(entry); } } }