List of usage examples for org.eclipse.jface.preference IPreferenceStore getBoolean
boolean getBoolean(String name);
From source file:com.centurylink.mdw.plugin.designer.wizards.ExportPackagePage.java
License:Apache License
private void createIncludeTaskTemplates(Composite parent, int ncol) { includeTaskTemplsCheckbox = new Button(parent, SWT.CHECK | SWT.LEFT); GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = ncol;// w w w. j a v a 2s.c o m gd.verticalIndent = 10; includeTaskTemplsCheckbox.setLayoutData(gd); includeTaskTemplsCheckbox.setText("Include Task Templates"); includeTaskTemplsCheckbox.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean checked = includeTaskTemplsCheckbox.getSelection(); IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); prefsStore.setValue(PreferenceConstants.PREFS_SUPPRESS_TASK_TEMPLATES_IN_PKG_EXPORT, !checked); } }); IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); boolean includeTaskTemplates = !prefsStore .getBoolean(PreferenceConstants.PREFS_SUPPRESS_TASK_TEMPLATES_IN_PKG_EXPORT); includeTaskTemplsCheckbox.setSelection(includeTaskTemplates); }
From source file:com.centurylink.mdw.plugin.designer.wizards.ExportPackagePage.java
License:Apache License
private void createInferImplementors(Composite parent, int ncol) { inferImplsCheckbox = new Button(parent, SWT.CHECK | SWT.LEFT); GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = ncol;//w ww . ja v a2s .c o m gd.verticalIndent = 10; inferImplsCheckbox.setLayoutData(gd); inferImplsCheckbox.setText("Infer Referenced Activity Implementors"); inferImplsCheckbox.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean checked = inferImplsCheckbox.getSelection(); IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); prefsStore.setValue(PreferenceConstants.PREFS_SUPPRESS_INFER_REFERENCED_IMPLS_DURING_EXPORT, !checked); } }); IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); boolean inferReferencedImpls = !prefsStore .getBoolean(PreferenceConstants.PREFS_SUPPRESS_INFER_REFERENCED_IMPLS_DURING_EXPORT); inferImplsCheckbox.setSelection(inferReferencedImpls); }
From source file:com.centurylink.mdw.plugin.designer.wizards.ExportPackageWizard.java
License:Apache License
void performImportExport(ProgressMonitor progressMonitor) throws IOException, JSONException, XmlException, DataAccessException, ActionCancelledException { Exporter exporter = new Exporter(getProject().getDesignerDataAccess()); boolean exportJson = false; boolean includeTaskTemplates = false; boolean inferReferencedImpls = false; IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); if (getProject().isFilePersist()) { exportJson = prefsStore.getBoolean(PreferenceConstants.PREFS_EXPORT_JSON_FORMAT); includeTaskTemplates = !prefsStore .getBoolean(PreferenceConstants.PREFS_SUPPRESS_TASK_TEMPLATES_IN_PKG_EXPORT); } else {/*from w w w. j av a 2s.co m*/ inferReferencedImpls = !prefsStore .getBoolean(PreferenceConstants.PREFS_SUPPRESS_INFER_REFERENCED_IMPLS_DURING_EXPORT); } List<WorkflowPackage> packages = getPackages(); String export; if (packages.size() == 1 && !exportJson) export = exporter.exportPackage(packages.get(0), includeTaskTemplates, inferReferencedImpls, progressMonitor); else export = exporter.exportPackages(packages, exportJson, includeTaskTemplates, progressMonitor); progressMonitor.progress(10); progressMonitor.subTask("Writing " + (exportJson ? "JSON" : "XML") + " file"); writeFile(getPage().getFilePath(), export.getBytes()); progressMonitor.progress(5); }
From source file:com.centurylink.mdw.plugin.MessageConsole.java
License:Apache License
public boolean isShowPref() { IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); return store.getBoolean(MessageConsolePageParticipant.PREFS_KEY + "_" + coreName.replaceAll(" ", "")); }
From source file:com.centurylink.mdw.plugin.preferences.MdwPreferencePage.java
License:Apache License
protected void initializeValues() { IPreferenceStore store = getPreferenceStore(); int reportingLevel = store.getInt(PREFS_MDW_REPORTING_LEVEL); mdwReportingLevelCombo/*w ww. ja va2 s. co m*/ .setText(reportingLevel + " - " + PluginMessages.MESSAGE_LEVELS.get(new Integer(reportingLevel))); logTimingsCheckbox.setSelection(store.getBoolean(PREFS_LOG_TIMINGS)); logConnectErrorsCheckbox.setSelection(store.getBoolean(PREFS_LOG_CONNECT_ERRORS)); copyrightNoticeTextArea.setText(store.getString(PREFS_COPYRIGHT_NOTICE)); jdbcFetchSizeText.setText(String.valueOf(store.getInt(PREFS_JDBC_FETCH_SIZE))); eventManagerCheckbox.setSelection(store.getBoolean(PREFS_SWING_LAUNCH_EVENT_MANAGER)); threadPoolManagerCheckbox.setSelection(store.getBoolean(PREFS_SWING_LAUNCH_THREAD_POOL_MANAGER)); useDiscoveredVcsCredsCheckbox.setSelection(store.getBoolean(PREFS_USE_DISCOVERED_VCS_CREDS)); }
From source file:com.centurylink.mdw.plugin.preferences.model.MdwSettings.java
License:Apache License
public void initialize() { setDefaultValues();/* w ww.jav a 2s. co m*/ IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); String relUrl = store.getString(PREFS_MDW_RELEASES_URL); if (relUrl.endsWith("/")) relUrl = relUrl.substring(0, relUrl.length() - 1); setMdwReleasesUrl(relUrl); if (getMdwReleasesUrl().length() == 0) setMdwReleasesUrl(store.getDefaultString(PREFS_MDW_RELEASES_URL)); setWorkspaceSetupUrl(store.getString(PREFS_WORKSPACE_SETUP_URL)); if (getWorkspaceSetupUrl().length() == 0) setWorkspaceSetupUrl(store.getDefaultString(PREFS_WORKSPACE_SETUP_URL)); setDiscoveryUrl(store.getString(PREFS_DISCOVERY_URL)); if (getDiscoveryUrl().length() == 0) setDiscoveryUrl(store.getDefaultString(PREFS_DISCOVERY_URL)); setIncludePreviewBuilds(store.getBoolean(PREFS_INCLUDE_PREVIEW_BUILDS)); setJdbcFetchSize(store.getInt(PREFS_JDBC_FETCH_SIZE)); if (getJdbcFetchSize() == 0) setJdbcFetchSize(store.getDefaultInt(PREFS_JDBC_FETCH_SIZE)); setCopyrightNotice(store.getString(PREFS_COPYRIGHT_NOTICE)); if (getCopyrightNotice().length() == 0) setCopyrightNotice(store.getDefaultString(PREFS_COPYRIGHT_NOTICE)); setInPlaceLabelEditing(store.getBoolean(PREFS_IN_PLACE_LABEL_EDITING)); setCompareConflictingAssetsDuringImport(store.getBoolean(PREFS_COMPARE_CONFLICTING_ASSETS)); setAllowDeleteArchivedProcesses(store.getBoolean(PREFS_ALLOW_DELETE_ARCHIVED_PROCESSES)); setAllowAssetNamesWithoutExtensions(store.getBoolean(PREFS_ALLOW_ASSETS_WITHOUT_EXTENSIONS)); setUseEmbeddedEditorForExcelAssets(store.getBoolean(PREFS_EMBEDDED_EDITOR_FOR_EXCEL)); setDoubleClickOpensSubprocessesAndScripts( store.getBoolean(PREFS_DOUBLE_CLICK_OPENS_SUBPROCESSES_AND_SCRIPTS)); setInferSmartSubprocVersionSpec(store.getBoolean(PREFS_INFER_SMART_SUBPROC_VERSION_SPEC)); setMdwReportingLevel(store.getInt(PREFS_MDW_REPORTING_LEVEL)); int red = store.getInt(PREFS_READONLY_BG_RED); int green = store.getInt(PREFS_READONLY_BG_GREEN); int blue = store.getInt(PREFS_READONLY_BG_BLUE); setReadOnlyBackground(new RGB(red, green, blue)); setTempResourceLocation(store.getString(PREFS_TEMP_RESOURCE_DIRECTORY)); if (getTempResourceLocation().length() == 0) setTempResourceLocation(store.getDefaultString(PREFS_TEMP_RESOURCE_DIRECTORY)); setTempFilesToKeep(store.getInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); if (getTempFilesToKeep() == 0) setTempFilesToKeep(store.getDefaultInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); setLoadScriptLibsOnEdit(store.getBoolean(PREFS_LOAD_SCRIPT_LIBS_ON_EDIT)); setWarnOverrideAttrsNotCarriedForward(store.getBoolean(PREFS_WARN_OVERRIDE_ATTRS_NOT_CARRIED_FORWARD)); logTimings = store.getBoolean(PREFS_LOG_TIMINGS); logConnectErrors = store.getBoolean(PREFS_LOG_CONNECT_ERRORS); swingLaunchEventManager = store.getBoolean(PREFS_SWING_LAUNCH_EVENT_MANAGER); swingLaunchThreadPoolManager = store.getBoolean(PREFS_SWING_LAUNCH_THREAD_POOL_MANAGER); useDiscoveredVcsCredentials = store.getBoolean(PREFS_USE_DISCOVERED_VCS_CREDS); setHttpConnectTimeout(store.getInt(PREFS_HTTP_CONNECT_TIMEOUT_MS)); setHttpReadTimeout(store.getInt(PREFS_HTTP_READ_TIMEOUT_MS)); setSmtpHost(store.getString(PREFS_SMTP_HOST)); setSmtpPort(store.getInt(PREFS_SMTP_PORT)); }
From source file:com.centurylink.mdw.plugin.preferences.ProcessDesignPreferencePage.java
License:Apache License
protected void initializeValues() { IPreferenceStore store = getPreferenceStore(); allowAssetNamesWithoutExtensionsCheckbox .setSelection(store.getBoolean(PREFS_ALLOW_ASSETS_WITHOUT_EXTENSIONS)); inPlaceLabelEditingCheckbox.setSelection(store.getBoolean(PREFS_IN_PLACE_LABEL_EDITING)); compareConflictingAssetsCheckbox.setSelection(store.getBoolean(PREFS_COMPARE_CONFLICTING_ASSETS)); allowDeleteArchivedProcessesCheckbox.setSelection(store.getBoolean(PREFS_ALLOW_DELETE_ARCHIVED_PROCESSES)); doubleClickOpensSubprocsAndScriptsCheckbox .setSelection(store.getBoolean(PREFS_DOUBLE_CLICK_OPENS_SUBPROCESSES_AND_SCRIPTS)); inferSmartSubprocVersionSpecCheckbox.setSelection(store.getBoolean(PREFS_INFER_SMART_SUBPROC_VERSION_SPEC)); showBamEventDataFieldCheckbox.setSelection(store.getBoolean(PREFS_SHOW_BAM_EVENT_DATA_INPUT_FIELD)); warnOverrideAttrsNotCarriedForwardCheckbox .setSelection(store.getBoolean(PREFS_WARN_OVERRIDE_ATTRS_NOT_CARRIED_FORWARD)); embeddedEditorForExcelCheckbox.setSelection(store.getBoolean(PREFS_EMBEDDED_EDITOR_FOR_EXCEL)); int red = store.getInt(PREFS_READONLY_BG_RED); int green = store.getInt(PREFS_READONLY_BG_GREEN); int blue = store.getInt(PREFS_READONLY_BG_BLUE); readOnlyBackgroundRgb = new RGB(red, green, blue); colorDialog.setRGB(readOnlyBackgroundRgb); tempResourceLocationText.setText(store.getString(PREFS_TEMP_RESOURCE_DIRECTORY)); previousTempFileVersionsSpinner.setSelection(store.getInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); loadScriptLibsOnEditCheckbox.setSelection(store.getBoolean(PREFS_LOAD_SCRIPT_LIBS_ON_EDIT)); }
From source file:com.centurylink.mdw.plugin.preferences.UrlsPreferencePage.java
License:Apache License
protected void initializeValues() { IPreferenceStore store = getPreferenceStore(); mdwReleasesUrlTextField.setText(store.getString(PREFS_MDW_RELEASES_URL)); includePreviewReleasesCheckbox.setSelection(store.getBoolean(PREFS_INCLUDE_PREVIEW_BUILDS)); workspaceSetupUrlTextField.setText(store.getString(PREFS_WORKSPACE_SETUP_URL)); discoveryUrlTextField.setText(store.getString(PREFS_DISCOVERY_URL)); httpConnectTimeoutText.setText(String.valueOf(store.getInt(PREFS_HTTP_CONNECT_TIMEOUT_MS))); httpReadTimeoutText.setText(String.valueOf(store.getInt(PREFS_HTTP_READ_TIMEOUT_MS))); smtpHostTextField.setText(store.getString(PREFS_SMTP_HOST)); smtpPortTextField.setText(String.valueOf(store.getInt(PREFS_SMTP_PORT))); }
From source file:com.centurylink.mdw.plugin.server.ServerRunner.java
License:Apache License
public static boolean isServerRunning() { IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); return store.getBoolean(PreferenceConstants.PREFS_SERVER_RUNNING); }
From source file:com.centurylink.mdw.plugin.workspace.ArtifactResourceListener.java
License:Apache License
public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { IResourceDelta rootDelta = event.getDelta(); IResourceDelta artifactDelta = rootDelta.findMember(tempFile.getFullPath()); if (artifactDelta != null && artifactDelta.getKind() == IResourceDelta.CHANGED && (artifactDelta.getFlags() & IResourceDelta.CONTENT) != 0) { // the file has been changed final Display display = Display.getCurrent(); if (display != null) { display.syncExec(new Runnable() { public void run() { byte[] newValue = PluginUtil.readFile(tempFile); String attrVal = valueProvider.isBinary() ? encodeBase64(newValue) : new String(newValue); if (getElement() instanceof Activity || getElement() instanceof WorkflowProcess) { WorkflowProcess processVersion = null; if (getElement() instanceof Activity) { Activity activity = (Activity) getElement(); activity.setAttribute(valueProvider.getAttributeName(), attrVal); processVersion = activity.getProcess(); } else { processVersion = (WorkflowProcess) getElement(); processVersion.setAttribute(valueProvider.getAttributeName(), attrVal); }//ww w. j av a 2s . c om processVersion.fireDirtyStateChanged(true); ProcessEditor processEditor = findProcessEditor(processVersion); if (processEditor == null) { try { processEditor = openProcessEditor(processVersion); IEditorPart tempFileEditor = findTempFileEditor(tempFile); if (tempFileEditor != null) processEditor.addActiveScriptEditor(tempFileEditor); } catch (PartInitException ex) { PluginMessages.uiError(display.getActiveShell(), ex, "Open Process", processVersion.getProject()); return; } } processVersion = processEditor.getProcess(); if (processVersion.isReadOnly()) { WorkflowProject workflowProject = getElement().getProject(); PluginMessages.uiMessage( "Process for '" + getElement().getName() + "' in workflow project '" + workflowProject.getName() + "' is Read Only.", "Not Updated", workflowProject, PluginMessages.INFO_MESSAGE); return; } if (getElement() instanceof Activity) { Activity activity = (Activity) getElement(); // the activity the attribute was set on // above may be a holdover from a // previously-opened process version for (Node node : processEditor.getProcessCanvasWrapper().getFlowchartPage() .getProcess().nodes) { if (activity.getLogicalId() != null && activity.getLogicalId() .equals(node.getAttribute("LOGICAL_ID"))) { node.setAttribute(valueProvider.getAttributeName(), attrVal); ActivityImpl actImpl = processVersion.getProject() .getActivityImpl(node.nodet.getImplementorClassName()); element = new Activity(node, processVersion, actImpl); } } activity.fireDirtyStateChanged(true); } processEditor.dirtyStateChanged(true); valueProvider.afterTempFileSaved(); // process editor is open String message = valueProvider.getArtifactTypeDescription() + " temporary file has been saved locally; however, you must still save the process for the changes to be persisted."; String toggleMessage = "Don't show me this message again."; IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore(); String prefsKey = "Mdw" + valueProvider.getArtifactTypeDescription() + "SuppressSaveNag"; if (!prefsStore.getBoolean(prefsKey)) { MessageDialogWithToggle dialog = MessageDialogWithToggle.openInformation( display.getActiveShell(), "Artifact Save", message, toggleMessage, false, null, null); prefsStore.setValue(prefsKey, dialog.getToggleState()); } } } }); } } } }