Java Code Examples for org.eclipse.jface.preference.IPreferenceStore

The following are top voted examples for showing how to use org.eclipse.jface.preference.IPreferenceStore. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: n4js   File: N4JSBuilderPreferenceAccess.java   Source Code and License 6 votes vote down vote up
private void intializeBuilderPreferences(IPreferenceStore store) {
	for (CompilerDescriptor compilerDescriptor : compositeGenerator.getCompilerDescriptors()) {
		for (CompilerProperties prop : CompilerProperties.values()) {
			if (prop.getType() == Boolean.class) {
				store.setDefault(
						prop.getKey(compilerDescriptor.getIdentifier()),
						(Boolean) prop.getValueInCompilerDescriptor(compilerDescriptor,
								compilerDescriptor.getIdentifier()));
			} else {
				store.setDefault(
						prop.getKey(compilerDescriptor.getIdentifier()),
						(String) prop.getValueInCompilerDescriptor(compilerDescriptor,
								compilerDescriptor.getIdentifier()));
			}
		}
	}
}
 
Example 2
Project: eclipse-batch-editor   File: BatchSourceViewerConfiguration.java   Source Code and License 6 votes vote down vote up
/**
 * Creates configuration by given adaptable
 * 
 * @param adaptable
 *            must provide {@link ColorManager} and {@link IFile}
 */
public BatchSourceViewerConfiguration(IAdaptable adaptable) {
	IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
	this.fPreferenceStore = new ChainedPreferenceStore(
			new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });

	Assert.isNotNull(adaptable, "adaptable may not be null!");
	this.annotationHoover = new BatchEditorAnnotationHoover();
	
	this.contentAssistant = new ContentAssistant();
	contentAssistProcessor = new BatchEditorSimpleWordContentAssistProcessor();
	contentAssistant.enableColoredLabels(true);
	
	contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
	for (BatchDocumentIdentifier identifier: BatchDocumentIdentifiers.values()){
		contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
	}
	
	contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());

	this.colorManager = adaptable.getAdapter(ColorManager.class);
	Assert.isNotNull(colorManager, " adaptable must support color manager");
	this.defaultTextAttribute = new TextAttribute(
			colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
	this.adaptable=adaptable;
}
 
Example 3
Project: ec4e   File: PreferenceStoreHelper.java   Source Code and License 6 votes vote down vote up
public static IPreferenceStore contributeToPreferenceStore(ITextEditor textEditor,
		IPreferenceStore preferenceStore) {
	try {
		// Get old store
		IPreferenceStore oldStore = getPreferenceStore(textEditor);
		// Create chained store with preference store to add
		IPreferenceStore newStore = new ChainedPreferenceStore(
				new IPreferenceStore[] { preferenceStore, oldStore });
		// Update the text editor with new preference store
		setPreferenceStoreOfTextEditor(textEditor, newStore);
		// Update the source viewer configuration with new preference store
		setPreferenceStoreOfSourceViewerConfiguration(textEditor, newStore);
		return newStore;

	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}

}
 
Example 4
Project: ec4e   File: NewEditorConfigWizard.java   Source Code and License 6 votes vote down vote up
/**
 * Returns the content of the .editorconfig file to generate.
 *
 * @param container
 *
 * @return the content of the .editorconfig file to generate.
 */
private InputStream openContentStream(IContainer container) {
	IPreferenceStore store = EditorsUI.getPreferenceStore();
	boolean spacesForTabs = store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS);
	int tabWidth = store.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
	String lineDelimiter = getLineDelimiter(container);
	String endOfLine = org.ec4j.core.model.PropertyType.EndOfLineValue.ofEndOfLineString(lineDelimiter).name();

	StringBuilder content = new StringBuilder("# EditorConfig is awesome: http://EditorConfig.org");
	content.append(lineDelimiter);
	content.append(lineDelimiter);
	content.append("[*]");
	content.append(lineDelimiter);
	content.append("indent_style = ");
	content.append(spacesForTabs ? "space" : "tab");
	content.append(lineDelimiter);
	content.append("indent_size = ");
	content.append(tabWidth);
	if (endOfLine != null) {
		content.append(lineDelimiter);
		content.append("end_of_line = ");
		content.append(endOfLine);
	}

	return new ByteArrayInputStream(content.toString().getBytes());
}
 
Example 5
Project: scanning   File: StatusQueueLaunchView.java   Source Code and License 6 votes vote down vote up
private void createTextControl(String slabel, final String propName, Composite content) {

		final IPreferenceStore store = Activator.getDefault().getPreferenceStore();

		final Label label = new Label(content, SWT.NONE);
		label.setText(slabel);

		final Text text = new Text(content, SWT.BORDER);
		text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
		text.setText(store.getString(propName));
		text.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				store.setValue(propName, text.getText());
			}
		});
	}
 
Example 6
Project: scanning   File: StatusQueueLaunchView.java   Source Code and License 6 votes vote down vote up
private void openQueueMonitor() throws UnsupportedEncodingException {

		final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
		String bundle = store.getString(BUNDLE);
		String bean   = store.getString(BEAN);
		String sqn    = store.getString(STATUS_QUEUE);
		String stn    = store.getString(STATUS_TOPIC);
		String submit = store.getString(SUBMIT_QUEUE);
		String part   = store.getString(PART_NAME);

		String queueViewId = QueueViews.createSecondaryId(bundle,bean, sqn, stn, submit);
		queueViewId = queueViewId+"partName="+part;
		try {
			Util.getPage().showView(StatusQueueView.ID, queueViewId, IWorkbenchPage.VIEW_VISIBLE);
		} catch (PartInitException e) {
			ErrorDialog.openError(Display.getDefault().getActiveShell(), "Cannot open view", "Cannot open view "+queueViewId,
					new Status(Status.ERROR, "org.eclipse.scanning.event.ui", e.getMessage()));
			logger.error("Cannot open view", e);
		}
	}
 
Example 7
Project: eclipse-bash-editor   File: BashSourceViewerConfiguration.java   Source Code and License 6 votes vote down vote up
/**
 * Creates configuration by given adaptable
 * 
 * @param adaptable
 *            must provide {@link ColorManager} and {@link IFile}
 */
public BashSourceViewerConfiguration(IAdaptable adaptable) {
	IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
	this.fPreferenceStore = new ChainedPreferenceStore(
			new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });

	Assert.isNotNull(adaptable, "adaptable may not be null!");
	this.annotationHoover = new BashEditorAnnotationHoover();
	
	this.contentAssistant = new ContentAssistant();
	contentAssistProcessor = new BashEditorSimpleWordContentAssistProcessor();
	contentAssistant.enableColoredLabels(true);
	
	contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
	for (BashDocumentIdentifier identifier: BashDocumentIdentifiers.values()){
		contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
	}
	
	contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());

	this.colorManager = adaptable.getAdapter(ColorManager.class);
	Assert.isNotNull(colorManager, " adaptable must support color manager");
	this.defaultTextAttribute = new TextAttribute(
			colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
	this.adaptable=adaptable;
}
 
Example 8
Project: Equella   File: JPFRepositoryPage.java   Source Code and License 6 votes vote down vote up
/**
 * @see PreferencePage#performOk
 */
@Override
public boolean performOk()
{
	if( !modified )
	{
		return true;
	}
	StructuredSelection selection = (StructuredSelection) listViewer.getSelection();
	IProject project = (IProject) selection.getFirstElement();
	if( project != null )
	{
		IPreferenceStore prefs = getPreferenceStore();
		prefs.setValue(JPFClasspathPlugin.PREF_REGISTRY_NAME, project.getName());
		try
		{
			((IPersistentPreferenceStore) prefs).save();
		}
		catch( IOException e )
		{
			JPFClasspathLog.logError(e);
		}
	}
	return true;
}
 
Example 9
Project: pgcodekeeper   File: DbStorePicker.java   Source Code and License 6 votes vote down vote up
public static File chooseDbSource(Shell shell, IPreferenceStore prefStore, boolean dir) {
    String pathToDump = dir ? getDirPath(shell, prefStore) : getFilePath(shell, prefStore);
    if (pathToDump == null) {
        return null;
    }

    File dumpFile = new File(pathToDump);
    Deque<File> dumpHistory = stringToDumpFileHistory(prefStore.getString(PREF.DB_STORE_FILES));
    dumpHistory.addFirst(dumpFile);
    while (dumpHistory.size() > MAX_FILES_HISTORY) {
        dumpHistory.removeLast();
    }
    prefStore.setValue(PREF.DB_STORE_FILES, dumpFileHistoryToPreference(dumpHistory));
    prefStore.setValue(PREF.LAST_OPENED_LOCATION,
            dir ? dumpFile.getAbsolutePath() : dumpFile.getParent());
    return dumpFile;
}
 
Example 10
Project: n4js   File: N4JSBuilderPreferenceAccess.java   Source Code and License 5 votes vote down vote up
@Override
public void setAutoBuildEnabled(Object context, boolean enabled) {
	IPreferenceStore preferenceStore = preferenceStoreAccess.getWritablePreferenceStore(context);
	String key = null;
	for (CompilerDescriptor compilerDescriptor : compositeGenerator.getCompilerDescriptors()) {
		key = CompilerProperties.IS_ACTIVE.getKey(compilerDescriptor.getIdentifier());
		preferenceStore.setValue(key, enabled);
	}
}
 
Example 11
Project: n4js   File: AbstractN4JSPreferencePage.java   Source Code and License 5 votes vote down vote up
/**
 * The field have to use OUTPUT_PREFERENCE_TAG as name as the chain of field editor make up the full qualified name
 * of the field editors contained by this field editor
 */
private ComponentDetailsFieldEditor doCreateField(IPreferenceStore preferenceStore) {
	return new ComponentDetailsFieldEditor(
			CompilerProperties.OUTPUT_PREFERENCE_TAG,
			"Registered compilers", getFieldEditorParent(), preferenceStore, components) {

		@Override
		protected IComponentProperties<?>[] getComponentProperties() {
			return getComponentPropertiesValues();
		}

	};
}
 
Example 12
Project: n4js   File: AbstractN4JSPreferencePage.java   Source Code and License 5 votes vote down vote up
@Override
protected void createFieldEditors() {
	refreshAttributes();
	IPreferenceStore preferenceStore = preferenceStoreAccessImpl.getWritablePreferenceStore(getProject());
	field = doCreateField(preferenceStore);
	addField(field);
}
 
Example 13
Project: ec4e   File: EditorConfigReconciler.java   Source Code and License 5 votes vote down vote up
private static IReconcilingStrategy create(IPreferenceStore preferenceStore, IResource resource) {
	if (EditorConfigConstants.EDITORCONFIG.equals(resource.getName())) {
		// it's an .editorconfig file, add validation
		CompositeReconcilingStrategy strategy = new CompositeReconcilingStrategy();
		strategy.setReconcilingStrategies(new IReconcilingStrategy[] { new ValidateEditorConfigStrategy(resource),
				new ValidateAppliedOptionsStrategy(preferenceStore, resource), new EditorConfigFoldingStrategy() });
		return strategy;
	}
	return new ValidateAppliedOptionsStrategy(preferenceStore, resource);
}
 
Example 14
Project: n4js   File: AbstractN4JSPreferencePage.java   Source Code and License 5 votes vote down vote up
private void setDescriptorValuesFromPreferences(IPreferenceStore preferenceStore, String outputName,
		DESCR_TYPE newCompilerDescriptor) {
	for (IComponentProperties<DESCR_TYPE> prop : getComponentPropertiesValues()) {
		if (preferenceStore.contains(prop.getKey(outputName))) {
			if (prop.getType() == Boolean.class) {
				prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
						preferenceStore.getBoolean(prop.getKey(outputName)));
			} else { // String
				prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
						preferenceStore.getString(prop.getKey(outputName)));
			}
		}
	}
}
 
Example 15
Project: n4js   File: ComponentPreferencesDetailsPart.java   Source Code and License 5 votes vote down vote up
/**
 * @return the preference stores associated with the field editors (they store their values in separate preference
 *         stores)
 */
public List<IPreferenceStore> getPreferenceStores() {
	List<IPreferenceStore> stores = new ArrayList<>();
	for (FieldEditor field : fields) {
		stores.add(field.getPreferenceStore());
	}
	return stores;
}
 
Example 16
Project: n4js   File: AbstractN4JSPreferenceStoreAccessor.java   Source Code and License 5 votes vote down vote up
/**
 * @param outputName
 *            the output name that identifies the output configuration but in our case also the registered compiler.
 * @param compilerDescriptor
 *            the compiler descriptor holding the values either stored last time this details page was used or the
 *            default values for the compiler
 */
public void populateCompilerConfiguration(String outputName, T compilerDescriptor) {
	// defaults
	preferenceInitializer.initialize(scopedAccessor);

	boolean initialLoad = false;

	ComponentDescriptor currentlyStoredCompilerDescriptor = compilerDescriptor
			.getCurrentlyStoredComponentDescriptor();
	if (currentlyStoredCompilerDescriptor == null) {
		currentlyStoredCompilerDescriptor = compilerDescriptor; // default configuration
		initialLoad = true;
	}

	Map<String, String> originalSettings = currentlyStoredCompilerDescriptor.fillMap(outputName);

	IPreferenceStore preferenceStore = getPreferenceStore();
	// populate
	// use a copy here has we don't want to change the default values provided by the registered compilers
	@SuppressWarnings("unchecked")
	T newCompilerDescriptor = (T) compilerDescriptor.copy();
	for (IComponentProperties<T> prop : getComponentPropertiesValues()) {
		if (prop.getType() == Boolean.class) {
			prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
					preferenceStore.getBoolean(prop.getKey(outputName)));
		} else {
			prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
					preferenceStore.getString(prop.getKey(outputName)));
		}
	}

	Map<String, String> currentSettings = newCompilerDescriptor.fillMap(outputName);

	Map<String, ValueDifference<String>> changes = getPreferenceChanges(originalSettings, currentSettings);

	if (!initialLoad) {
		compilerDescriptor.setChanges(changes);
	}
	compilerDescriptor.setCurrentlyStoredComponentDescriptor(newCompilerDescriptor);
}
 
Example 17
Project: n4js   File: ComponentDetailsFieldEditor.java   Source Code and License 5 votes vote down vote up
/**
 * @return the preference stores associated with the contained field editors (they store their values in separate
 *         preference stores)
 */
public List<IPreferenceStore> getPreferenceStores() {
	if (detailsPart != null) {
		return detailsPart.getPreferenceStores();
	}
	return new ArrayList<>();
}
 
Example 18
Project: eclipse-batch-editor   File: BatchEditor.java   Source Code and License 5 votes vote down vote up
/**
 * Installs an additional source viewer support which uses editor
 * preferences instead of standard text preferences. If standard source
 * viewer support would be set with editor preferences all standard
 * preferences would be lost or had to be reimplmented. To avoid this
 * another source viewer support is installed...
 */
private void installAdditionalSourceViewerSupport() {

	additionalSourceViewerSupport = new SourceViewerDecorationSupport(getSourceViewer(), getOverviewRuler(),
			getAnnotationAccess(), getSharedColors());
	additionalSourceViewerSupport.setCharacterPairMatcher(bracketMatcher);
	additionalSourceViewerSupport.setMatchingCharacterPainterPreferenceKeys(
			P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), P_EDITOR_MATCHING_BRACKETS_COLOR.getId(),
			P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), P_EDITOR_ENCLOSING_BRACKETS.getId());

	IPreferenceStore preferenceStoreForDecorationSupport = BatchEditorUtil.getPreferences().getPreferenceStore();
	additionalSourceViewerSupport.install(preferenceStoreForDecorationSupport);
}
 
Example 19
Project: pmTrans   File: Config.java   Source Code and License 5 votes vote down vote up
@Override
protected void doStore() {
	if (!character.getText().equals("[space]")
			&& character.getText().length() > 1) {
		MessageDialog
				.openError(
						Display.getCurrent().getActiveShell(),
						"Error",
						"The key "
								+ character.getText()
								+ " is not supported as a shortcut. Please use another one.");
		doLoadDefault();
		return;
	}
	String c = character.getText().equals("[space]") ? " " : character
			.getText();

	IPreferenceStore ps = getPreferenceStore();
	updateAccelerators();
	accelerators = accelerators.replace(ps.getString(keyConst), "");
	if (accelerators.contains(c)) {
		MessageDialog
				.openError(
						Display.getCurrent().getActiveShell(),
						"Error",
						"The key "
								+ c
								+ " is already used as a shortcut. Please use another one.");
		doLoad();
		updateAccelerators();
		return;
	}
	ps.setValue(keyConst, c);
}
 
Example 20
Project: neoscada   File: PreferenceInitializer.java   Source Code and License 5 votes vote down vote up
@Override
public void initializeDefaultPreferences ()
{
    final IPreferenceStore store = Activator.getDefault ().getPreferenceStore ();
    store.setDefault ( PreferenceConstants.BELL_ACTIVATED_KEY, true );
    store.setDefault ( PreferenceConstants.NUMBER_OF_EVENTS_KEY, 0 );
    store.setDefault ( PreferenceConstants.CUT_LIST_ALL_SECONDS_KEY, 10 * 60 );
}
 
Example 21
Project: bdf2   File: DatabaseAction.java   Source Code and License 5 votes vote down vote up
private int validateDb() {
	editor = (DbToolGefEditor) getWorkbenchPart().getAdapter(GraphicalEditor.class);
	schema = editor.getModel();
	dbDialect = DbDialectManager.getDbDialect(schema.getCurrentDbType());
	IPreferenceStore store = Activator.getDefault().getPreferenceStore();
	String driverLocation = store.getString(schema.getCurrentDbType());
	if (driverLocation.trim().length() == 0) {
		return openDbDriverLocationDialog(schema.getCurrentDbType(), dbDialect.getJdbcDriverName(), driverLocation);
	} else {
		return attemptTestJdbcDriver(schema.getCurrentDbType(), dbDialect.getJdbcDriverName(), driverLocation);
	}
}
 
Example 22
Project: scanning   File: StatusQueueLaunchView.java   Source Code and License 5 votes vote down vote up
public StatusQueueLaunchView() {
	IPreferenceStore store = Activator.getDefault().getPreferenceStore();
	store.setDefault(BUNDLE, "org.dawnsci.commandserver.SOMETHING");
	store.setDefault(BEAN,   "org.dawnsci.commandserver.SOMETHING.YourStatusBean");
	store.setDefault(STATUS_QUEUE, "scisoft.SOMETHING.STATUS_QUEUE");
	store.setDefault(STATUS_TOPIC, "scisoft.SOMETHING.STATUS_TOPIC");
	store.setDefault(SUBMIT_QUEUE, "scisoft.SOMETHING.SUBMISSION_QUEUE");
	store.setDefault(PART_NAME,    "Queue Monitor");
}
 
Example 23
Project: scanning   File: Activator.java   Source Code and License 5 votes vote down vote up
/**
    * Get the command value if it has been changed by the user.
    * @param key
    * @return
    */
   private static final String getNovelCommandPreference(String key) {
	final IPreferenceStore store = getDefault().getPreferenceStore();
String val = store.getString(key);
String def = store.getDefaultString(key);
if (!val.equals(def)) return val;
return null;
    }
 
Example 24
Project: scanning   File: ActiveMQPage.java   Source Code and License 5 votes vote down vote up
public ActiveMQPage() {
	super();

	final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
	setPreferenceStore(store);
	setDescription("Preferences for connecting auto-processing reruns to the command server.");
}
 
Example 25
Project: eclipse-bash-editor   File: BashEditor.java   Source Code and License 5 votes vote down vote up
/**
 * Installs an additional source viewer support which uses editor
 * preferences instead of standard text preferences. If standard source
 * viewer support would be set with editor preferences all standard
 * preferences would be lost or had to be reimplmented. To avoid this
 * another source viewer support is installed...
 */
private void installAdditionalSourceViewerSupport() {

	additionalSourceViewerSupport = new SourceViewerDecorationSupport(getSourceViewer(), getOverviewRuler(),
			getAnnotationAccess(), getSharedColors());
	additionalSourceViewerSupport.setCharacterPairMatcher(bracketMatcher);
	additionalSourceViewerSupport.setMatchingCharacterPainterPreferenceKeys(
			P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), P_EDITOR_MATCHING_BRACKETS_COLOR.getId(),
			P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), P_EDITOR_ENCLOSING_BRACKETS.getId());

	IPreferenceStore preferenceStoreForDecorationSupport = BashEditorUtil.getPreferences().getPreferenceStore();
	additionalSourceViewerSupport.install(preferenceStoreForDecorationSupport);
}
 
Example 26
Project: eclipse-uroborosql-formatter   File: PyConfigBinder.java   Source Code and License 5 votes vote down vote up
/**
 * Binding plugin settings to python.
 *
 * @param engine
 *            PyEngine
 */
public void bind(PyEngine engine) {
	IPreferenceStore store = UroborosqlFormatterPlugin.getDefault().getPreferenceStore();

	engine.eval("config = LocalConfig()");
	if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
		engine.eval("config.set_case('lower')");
	} else if (CaseType.UPPER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
		engine.eval("config.set_case('upper')");
	} else if (CaseType.CAPITALIZE.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
		engine.eval("config.set_case('capitalize')");
	}
	if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
		engine.eval("config.set_reserved_case('lower')");
	} else if (CaseType.UPPER.name()
			.equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
		engine.eval("config.set_reserved_case('upper')");
	} else if (CaseType.CAPITALIZE.name()
			.equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
		engine.eval("config.set_reserved_case('capitalize')");
	}
	if (store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS) != null) {
		String inputReservedWords = store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS);
		String[] reservedWords = inputReservedWords.split(",", 0);
		List<String> reservedWordsList = new ArrayList<String>();
		for (int i = 0; i < reservedWords.length; i++) {
			reservedWordsList.add(reservedWords[i]);
		}
		engine.put("input_reserved_words", reservedWordsList);
		engine.eval("config.set_input_reserved_words(input_reserved_words)");
	}
	if (CommentSyntaxType.Doma2.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.COMMENT_SYNTAX_TYPE))) {
		engine.eval("config.set_commentsyntax(Doma2CommentSyntax())");
	}
	if (store.getBoolean(UroborosqlFormatterPreferenceInitializer.USE_BACKSLASH)) {
		engine.eval("uroborosqlfmt.config.glb.escape_sequence_u005c = True");
	}
}
 
Example 27
Project: eclipse-uroborosql-formatter   File: UroborosqlFormatterPreferenceInitializer.java   Source Code and License 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
	IPreferenceStore store = UroborosqlFormatterPlugin.getDefault().getPreferenceStore();
	store.setDefault(USE_UPPERCASE, true);
	store.setDefault(HAS_BACKWARD_COMPATIBILITY_DONE, false);
	store.setDefault(CASE, CaseType.UPPER.name());
	store.setDefault(RESERVED_CASE, CaseType.UPPER.name());
	store.setDefault(RESERVED_WORDS, "");
	store.setDefault(USE_BACKSLASH, false);
	store.setDefault(COMMENT_SYNTAX_TYPE, CommentSyntaxType.Uroborosql.name());
}
 
Example 28
Project: bdf2   File: DbToolPreferencePage.java   Source Code and License 5 votes vote down vote up
private void initDbDriverMetaData() {
	IPreferenceStore store = Activator.getDefault().getPreferenceStore();
	dbDriverMetaDataList = new ArrayList<DbDriverMetaData>();
	List<DbDialect> dialects = DbDialectManager.getDialects();
	DbDriverMetaData dbDriverMetaData = null;
	for (DbDialect dbDialect : dialects) {
		dbDriverMetaData = new DbDriverMetaData();
		dbDriverMetaData.setDbNmae(dbDialect.getDbType());
		dbDriverMetaData.setDriverClassName(dbDialect.getJdbcDriverName());
		dbDriverMetaData.setDriverLocation(store.getString(dbDialect.getDbType()));
		dbDriverMetaDataList.add(dbDriverMetaData);
	}
}
 
Example 29
Project: Hydrograph   File: ExecutionTrackPreference.java   Source Code and License 5 votes vote down vote up
@Override
public void init(IWorkbench workbench) {
	IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
	preferenceStore.setDefault(ExecutionPreferenceConstants.EXECUTION_TRACKING, true);
	preferenceStore.setDefault(ExecutionPreferenceConstants.TRACKING_LOG_PATH,
			TrackingDisplayUtils.INSTANCE.getInstallationPath());
	
	setPreferenceStore(preferenceStore);
}
 
Example 30
Project: pgcodekeeper   File: DbSource.java   Source Code and License 5 votes vote down vote up
static PgDiffArguments getPgDiffArgs(String charset, String timeZone,
        boolean forceUnixNewlines) throws IOException {
    PgDiffArguments args = new PgDiffArguments();
    IPreferenceStore mainPS = Activator.getDefault().getPreferenceStore();
    args.setInCharsetName(charset);
    args.setAddTransaction(mainPS.getBoolean(DB_UPDATE_PREF.SCRIPT_IN_TRANSACTION));
    args.setDisableCheckFunctionBodies(!mainPS.getBoolean(DB_UPDATE_PREF.CHECK_FUNCTION_BODIES));
    args.setUsingTypeCastOff(!mainPS.getBoolean(DB_UPDATE_PREF.USING_ON_OFF));
    args.setIgnorePrivileges(mainPS.getBoolean(PREF.NO_PRIVILEGES));
    args.setTimeZone(timeZone);
    args.setKeepNewlines(!forceUnixNewlines);
    return args;
}
 
Example 31
Project: pgcodekeeper   File: DbSource.java   Source Code and License 5 votes vote down vote up
public static DbSource fromDbInfo(DbInfo dbinfo, IPreferenceStore prefs,
        boolean forceUnixNewlines, String charset, String timezone) {
    if (prefs.getBoolean(PREF.PGDUMP_SWITCH)) {
        return DbSource.fromDb(forceUnixNewlines,
                prefs.getString(PREF.PGDUMP_EXE_PATH),
                prefs.getString(PREF.PGDUMP_CUSTOM_PARAMS),
                dbinfo.getDbHost(), dbinfo.getDbPort(),
                dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
                charset, timezone);
    } else {
        return DbSource.fromJdbc(dbinfo.getDbHost(), dbinfo.getDbPort(),
                dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
                timezone, forceUnixNewlines);
    }
}
 
Example 32
Project: pgcodekeeper   File: Differ.java   Source Code and License 5 votes vote down vote up
public Getter(PgDatabase db) {
    oldArgs = db.getArguments();
    consumer = (db::setArguments);
    PgDiffArguments newArgs = oldArgs.clone();
    IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
    newArgs.setConcurrentlyMode(prefs.getBoolean(DB_UPDATE_PREF.PRINT_INDEX_WITH_CONCURRENTLY));
    db.setArguments(newArgs);
}
 
Example 33
Project: pgcodekeeper   File: DbStorePicker.java   Source Code and License 5 votes vote down vote up
private static String getFilePath(Shell shell, IPreferenceStore prefStore) {
    FileDialog dialog = new FileDialog(shell);
    dialog.setText(Messages.choose_dump_file_with_changes);
    dialog.setFilterExtensions(new String[] {"*.sql", "*"}); //$NON-NLS-1$ //$NON-NLS-2$
    dialog.setFilterNames(new String[] {
            Messages.DiffPresentationPane_sql_file_filter,
            Messages.DiffPresentationPane_any_file_filter});
    dialog.setFilterPath(prefStore.getString(PREF.LAST_OPENED_LOCATION));
    return dialog.open();
}
 
Example 34
Project: pgcodekeeper   File: NewProjWizard.java   Source Code and License 5 votes vote down vote up
PageDb(String pageName, IPreferenceStore mainPrefs) {
    super(pageName, pageName, null);
    this.mainPrefs = mainPrefs;

    setTitle(Messages.NewProjWizard_proj_init);
    setDescription(Messages.NewProjWizard_proj_init_src);
}
 
Example 35
Project: pgcodekeeper   File: DiffWizard.java   Source Code and License 5 votes vote down vote up
public DiffWizard(PgDbProject proj, IPreferenceStore mainPrefs) {
    this.proj = proj;
    this.mainPrefs = mainPrefs;

    setWindowTitle(Messages.diffWizard_Diff);
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(
            Activator.getContext().getBundle().getResource(FILE.ICONAPPWIZ)));
    setNeedsProgressMonitor(true);
}
 
Example 36
Project: pgcodekeeper   File: DiffWizard.java   Source Code and License 5 votes vote down vote up
public PageDiff(String pageName, IPreferenceStore mainPrefs, PgDbProject proj) {
    super(pageName, pageName, null);

    this.mainPrefs = mainPrefs;
    this.proj = proj;
    setDescription(Messages.diffwizard_diffpage_select);
}
 
Example 37
Project: pgcodekeeper   File: PreferenceInitializer.java   Source Code and License 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    store.setDefault(PREF.PGDUMP_EXE_PATH, "pg_dump"); //$NON-NLS-1$
    store.setDefault(PREF.DB_STORE, "default\t\t\t\t\t0"); //$NON-NLS-1$
    store.setDefault(PREF.PGDUMP_CUSTOM_PARAMS, ""); //$NON-NLS-1$
    store.setDefault(PREF.FORCE_SHOW_CONSOLE, true);

    store.setDefault(PG_EDIT_PREF.EDITOR_UPDATE_ACTION, PG_EDIT_PREF.NO_ACTION);

    store.setDefault(DB_UPDATE_PREF.ALTER_COLUMN_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.DROP_COLUMN_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.DROP_TABLE_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.RESTART_WITH_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.SHOW_SCRIPT_OUTPUT_SEPARATELY, true);
    store.setDefault(DB_UPDATE_PREF.USING_ON_OFF, true);
    store.setDefault(DB_UPDATE_PREF.DELETE_SCRIPT_AFTER_CLOSE, MessageDialogWithToggle.PROMPT);
    store.setDefault(DB_UPDATE_PREF.CREATE_SCRIPT_IN_PROJECT, MessageDialogWithToggle.ALWAYS);
    store.setDefault(DB_UPDATE_PREF.MIGRATION_COMMAND, UIConsts.DDL_DEFAULT_CMD);

    store.setDefault(PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS, MessageDialogWithToggle.PROMPT);

    store.setDefault(COMMIT_PREF.CONSIDER_DEPCY_IN_COMMIT, true);

    store.setDefault(USAGE_REPORT_PREF.USAGEREPORT_ENABLED_ID, true);
    store.setDefault(USAGE_REPORT_PREF.ASK_USER_USAGEREPORT_ID, true);

    setSQLSyntaxColorDefaults(store);
}
 
Example 38
Project: bdf2   File: PreferenceInitializer.java   Source Code and License 5 votes vote down vote up
public void initializeDefaultPreferences() {
	IPreferenceStore store = Activator.getDefault().getPreferenceStore();
	store.setDefault(PreferenceConstants.BDF_VERSION, "1");
	store.setDefault(PreferenceConstants.URL_LIST,
			"http://localhost:8080/bdf-test/bdf.popertiesLoderController.downXmlPropdesc.c");
	store.setDefault(PreferenceConstants.HOST, "localhost");
	store.setDefault(PreferenceConstants.PORT, "8080");
}
 
Example 39
Project: ec4e   File: PreferenceStoreHelper.java   Source Code and License 5 votes vote down vote up
private static void setPreferenceStoreOfTextEditor(ITextEditor textEditor, IPreferenceStore preferenceStore)
		throws Exception {
	Method m = AbstractTextEditor.class.getDeclaredMethod("setPreferenceStore",
			new Class[] { IPreferenceStore.class });
	m.setAccessible(true);
	m.invoke(textEditor, preferenceStore);
}
 
Example 40
Project: pgcodekeeper   File: Diff.java   Source Code and License 5 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) {
    PgDbProject proj = OpenProjectUtils.getProject(event);
    Shell shell = HandlerUtil.getActiveShell(event);
    IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
    Log.log(Log.LOG_DEBUG, "Diff wizard about to show"); //$NON-NLS-1$
        
    WizardDialog dialog = new WizardDialog(
            shell, new DiffWizard(proj, prefStore));
    dialog.open();
    return null;
}
 
Example 41
Project: pgcodekeeper   File: SQLEditorSourceViewerConfiguration.java   Source Code and License 5 votes vote down vote up
public SQLEditorSourceViewerConfiguration(ISharedTextColors sharedColors,
        IPreferenceStore store, SQLEditor editor) {
    super(store);
    fSharedColors= sharedColors;
    this.prefs = Activator.getDefault().getPreferenceStore();
    this.editor = editor;
}
 
Example 42
Project: pgcodekeeper   File: SQLEditorSourceViewerConfiguration.java   Source Code and License 5 votes vote down vote up
private TextAttribute getTextAttribute(IPreferenceStore prefs, SQLEditorStatementTypes type) {
    SQLEditorSyntaxModel sm = new SQLEditorSyntaxModel(type, prefs).load();
    int style = 0 | (sm.isBold() ? SWT.BOLD : 0)
            | (sm.isItalic() ? SWT.ITALIC: 0)
            | (sm.isUnderline() ? SWT.UNDERLINE_SINGLE: 0)
            | (sm.isUnderline() ? TextAttribute.UNDERLINE: 0)
            | (sm.isStrikethrough() ? TextAttribute.STRIKETHROUGH: 0);
    return new TextAttribute(fSharedColors.getColor(sm.getColor()), null, style);
}
 
Example 43
Project: pgcodekeeper   File: CodekeeperConsole.java   Source Code and License 5 votes vote down vote up
@Override
protected void dispose() {
    Activator activator = Activator.getDefault();
    if (activator != null) {
        IPreferenceStore prefs = activator.getPreferenceStore();
        if (prefs != null) {
            prefs.removePropertyChangeListener(this);
        }
    }
    super.dispose();
}
 
Example 44
Project: iTrace-Archive   File: ITrace.java   Source Code and License 5 votes vote down vote up
public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    IPreferenceStore prefStore = getDefault().getPreferenceStore();
    EyeTrackerFactory.setTrackerType(EyeTrackerFactory.TrackerType.valueOf(
            prefStore.getString(PluginPreferences.EYE_TRACKER_TYPE)));
    activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
}
 
Example 45
Project: Hydrograph   File: ServicesPreference.java   Source Code and License 5 votes vote down vote up
@Override
public void init(IWorkbench workbench) {
	IPreferenceStore preferenceStore =PlatformUI.getPreferenceStore();
	preferenceStore.setDefault(PreferenceConstants.LOCAL_PORT_NO, DEFAULT_LOCAL_PORT);
	preferenceStore.setDefault(PreferenceConstants.REMOTE_PORT_NO, DEFAULT_REMOTE_PORT);
	preferenceStore.setDefault(PreferenceConstants.USE_REMOTE_CONFIGURATION, DEFAULT_USE_REMOTE_CONFIGURATION_CHECK);
	setPreferenceStore(preferenceStore);
}
 
Example 46
Project: Hydrograph   File: ServicesPreference.java   Source Code and License 5 votes vote down vote up
@Override
	protected void performDefaults() {
		IPreferenceStore preferenceStore = getPreferenceStore();
		localPortNo.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.LOCAL_PORT_NO));
		remotePortNo.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.REMOTE_PORT_NO));
		useRemoteConfigBooleanFieldEditor.loadDefault();
		super.performDefaults();
}
 
Example 47
Project: bdf2   File: DatabaseAction.java   Source Code and License 5 votes vote down vote up
private int openDbDriverLocationDialog(String dbType, String driverName, String driverLocation) {
	DbDriverMetaData dbDriverMetaData = new DbDriverMetaData();
	dbDriverMetaData.setDbNmae(dbType);
	dbDriverMetaData.setDriverClassName(driverName);
	dbDriverMetaData.setDriverLocation(driverLocation);
	DbDriverLocationDialog dialog = new DbDriverLocationDialog("请先配置数据库驱动", getWorkbenchPart().getSite().getShell(), dbDriverMetaData);
	if (dialog.open() == Dialog.OK) {
		dbDriverMetaData.setDriverLocation(dialog.getDriverLocation());
		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
		store.setValue(dbType, dialog.getDriverLocation());
		return attemptTestJdbcDriver(dbType, driverName, dbDriverMetaData.getDriverLocation());
	} else {
		return Dialog.CANCEL;
	}
}
 
Example 48
Project: Hydrograph   File: ViewDataPreference.java   Source Code and License 5 votes vote down vote up
@Override
protected void performDefaults() {
	IPreferenceStore preferenceStore = getPreferenceStore();
	tempPathFieldEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.VIEW_DATA_TEMP_FILEPATH));
	defaultPathFieldEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.DEFAULTPATH));
	pageSizeEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.VIEW_DATA_PAGE_SIZE));
	memoryFieldEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.VIEW_DATA_FILE_SIZE));
	delimiterEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.DELIMITER));
	quoteEditor.setStringValue(preferenceStore.getDefaultString(PreferenceConstants.QUOTE_CHARACTOR));
	booleanFieldEditor.loadDefault();
	purgeEditor.loadDefault();
	loadDefaultToRemoteHostEditor();
}
 
Example 49
Project: n4js   File: N4JSBuilderPreferenceAccess.java   Source Code and License 4 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore();
	intializeBuilderPreferences(store);
}
 
Example 50
Project: n4js   File: ComponentPreferencesDetailsPart.java   Source Code and License 4 votes vote down vote up
ComponentPreferencesDetailsPart(IPreferenceStore masterPreferenceStore,
		IComponentProperties<?>[] componentPropertiesValues) {
	super(masterPreferenceStore);
	this.componentPropertiesValues = componentPropertiesValues;
}
 
Example 51
Project: n4js   File: AbstractN4JSPreferenceStoreAccessor.java   Source Code and License 4 votes vote down vote up
private IPreferenceStore getPreferenceStore() {
	return scopedAccessor.getWritablePreferenceStore();
}
 
Example 52
Project: n4js   File: ComponentDetailsFieldEditor.java   Source Code and License 4 votes vote down vote up
ComponentDetailsFieldEditor(String name, String labelText, Composite composite,
		IPreferenceStore preferenceStore, List<?> list) {
	super(name, labelText, composite, preferenceStore, list);
}
 
Example 53
Project: n4js   File: StyledTextDescriptor.java   Source Code and License 4 votes vote down vote up
/**
 * Creates and returns with a new {@link StyledText styled text} instance hooked up to the given parent composite.
 *
 * @param parent
 *            the parent of the styled text control.
 * @param style
 *            style bits for the new text control.
 * @return a new styled text control initialized from the descriptor.
 */
default StyledText toStyledText(final Composite parent, final int style) {

	final StyledText text = new StyledText(parent, READ_ONLY | style);
	text.setText(getText());
	text.setStyleRanges(getRanges());
	text.setFont(getFont());
	text.setEditable(false);
	text.setEnabled(false);

	final AtomicReference<Color> colorRef = new AtomicReference<>();
	final IPreferenceStore prefStore = EditorsUI.getPreferenceStore();
	if (null == prefStore
			|| prefStore.getBoolean(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {

		colorRef.set(getDefault().getSystemColor(COLOR_LIST_BACKGROUND));

	} else {

		RGB rgb = null;
		if (prefStore.contains(PREFERENCE_COLOR_BACKGROUND)) {
			if (prefStore.isDefault(PREFERENCE_COLOR_BACKGROUND)) {
				rgb = getDefaultColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
			} else {
				rgb = getColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
			}
			if (rgb != null) {
				colorRef.set(new Color(text.getDisplay(), rgb));
			}
		}

	}

	if (null != colorRef.get()) {
		text.setBackground(colorRef.get());
		text.addDisposeListener(e -> {
			if (!colorRef.get().isDisposed()) {
				colorRef.get().dispose();
			}
		});
	}

	text.pack();
	return text;
}
 
Example 54
Project: eclipse-jenkins-editor   File: JenkinsEditorPreferences.java   Source Code and License 4 votes vote down vote up
protected IPreferenceStore createStore() {
	return new ScopedPreferenceStore(InstanceScope.INSTANCE, JenkinsEditorActivator.PLUGIN_ID);
}
 
Example 55
Project: eclipse-jenkins-editor   File: JenkinsEditorPreferenceInitializer.java   Source Code and License 4 votes vote down vote up
public void initializeDefaultPreferences() {
	IPreferenceStore store = getPreferences().getPreferenceStore();
	store.setDefault(P_LINK_OUTLINE_WITH_EDITOR.getId(), true);
	
	/* bracket rendering configuration */
	store.setDefault(P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), true); // per default matching is enabled, but without the two other special parts
	store.setDefault(P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), false);
	store.setDefault(P_EDITOR_ENCLOSING_BRACKETS.getId(), false);
	store.setDefault(P_EDITOR_AUTO_CREATE_END_BRACKETSY.getId(), true);
	
	store.setDefault(P_EDITOR_CODEASSIST_PROPOSALS_ENABLED.getId(), true);
	store.setDefault(P_EDITOR_CODEASSIST_NO_PROPOSALS_FOR_GETTER_OR_SETTERS.getId(), true);
	store.setDefault(P_EDITOR_CODEASSIST_TOOLTIPS_ENABLED.getId(), true);
	
	
	store.setDefault(P_EDITOR_CODEASSIST_PROPOSALS_ENABLED.getId(), true);
	store.setDefault(P_EDITOR_CODEASSIST_NO_PROPOSALS_FOR_GETTER_OR_SETTERS.getId(), true);
	store.setDefault(P_EDITOR_CODEASSIST_TOOLTIPS_ENABLED.getId(), true);
	
	/* CLI setup */
	store.setDefault(P_CERTIFICATE_CHECK_DISABLED.getId(), false);
	
	/* bracket color */
	getPreferences().setDefaultColor(P_EDITOR_MATCHING_BRACKETS_COLOR, JenkinsEditorColorConstants.GRAY_JAVA);
	
	/* editor colors */
	getPreferences().setDefaultColor(COLOR_NORMAL_TEXT, JenkinsEditorColorConstants.BLACK);

	getPreferences().setDefaultColor(COLOR_JAVA_KEYWORD, JenkinsEditorColorConstants.KEYWORD_DEFAULT_PURPLE);
	getPreferences().setDefaultColor(COLOR_GROOVY_KEYWORD, JenkinsEditorColorConstants.KEYWORD_DEFAULT_PURPLE);
	getPreferences().setDefaultColor(COLOR_GROOVY_DOC, JenkinsEditorColorConstants.DARK_BLUE);
	getPreferences().setDefaultColor(COLOR_NORMAL_STRING, JenkinsEditorColorConstants.STRING_DEFAULT_BLUE);
	getPreferences().setDefaultColor(COLOR_ANNOTATION, JenkinsEditorColorConstants.MIDDLE_GRAY);
	
	
	getPreferences().setDefaultColor(COLOR_GSTRING, JenkinsEditorColorConstants.ROYALBLUE);
	getPreferences().setDefaultColor(COLOR_COMMENT, JenkinsEditorColorConstants.GREEN_JAVA);
	
	getPreferences().setDefaultColor(COLOR_JENKINS_KEYWORDS, JenkinsEditorColorConstants.RED_KEYWORD);
	
	getPreferences().setDefaultColor(COLOR_JENKINS_VARIABLES, JenkinsEditorColorConstants.DARK_BLUE);
	getPreferences().setDefaultColor(COLOR_JAVA_LITERAL, JenkinsEditorColorConstants.KEYWORD_DEFAULT_PURPLE);
}
 
Example 56
Project: eclipse-batch-editor   File: BatchEditorPreferenceInitializer.java   Source Code and License 4 votes vote down vote up
public void initializeDefaultPreferences() {
	BatchEditorPreferences preferences = getPreferences();
	IPreferenceStore store = preferences.getPreferenceStore();
	
	/* Outline */
	store.setDefault(P_LINK_OUTLINE_WITH_EDITOR.getId(), true);
	
	/* ++++++++++++ */
	/* + Brackets + */
	/* ++++++++++++ */
	/* bracket rendering configuration */
	store.setDefault(P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), true); // per default matching is enabled, but without the two other special parts
	store.setDefault(P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), false);
	store.setDefault(P_EDITOR_ENCLOSING_BRACKETS.getId(), false);
	store.setDefault(P_EDITOR_AUTO_CREATE_END_BRACKETSY.getId(), true);
	
	/* bracket color */
	preferences.setDefaultColor(P_EDITOR_MATCHING_BRACKETS_COLOR, GRAY_JAVA);
	
	/* +++++++++++++++++++ */
	/* + Code Assistence + */
	/* +++++++++++++++++++ */
	store.setDefault(P_CODE_ASSIST_ADD_KEYWORDS.getId(), true);
	store.setDefault(P_CODE_ASSIST_ADD_SIMPLEWORDS.getId(), true);
	
	/* +++++++++++++++++ */
	/* + Editor Colors + */
	/* +++++++++++++++++ */
	preferences.setDefaultColor(COLOR_NORMAL_TEXT, BLACK);

	preferences.setDefaultColor(COLOR_BATCH_INTERNAL_KEYWORD, KEYWORD_DEFAULT_PURPLE);
	
	preferences.setDefaultColor(COLOR_GSTRING, ROYALBLUE);
	preferences.setDefaultColor(COLOR_COMMENT, GREEN_JAVA);
	
	preferences.setDefaultColor(COLOR_EXTERNAL_COMMAND, TASK_DEFAULT_RED);
	preferences.setDefaultColor(COLOR_KNOWN_VARIABLES, DARK_GRAY);
	preferences.setDefaultColor(COLOR_PARAMETERS, DARK_BLUE);
	
	preferences.setDefaultColor(COLOR_ECHO_OUTPUT, GRAY);
	
}
 
Example 57
Project: eclipse-batch-editor   File: BatchEditorPreferences.java   Source Code and License 4 votes vote down vote up
public IPreferenceStore getPreferenceStore() {
	return store;
}
 
Example 58
Project: pmTrans   File: Config.java   Source Code and License 4 votes vote down vote up
@Override
protected void doLoad() {
	IPreferenceStore ps = getPreferenceStore();
	character.setText(ps.getString(keyConst).equals(" ") ? "[space]"
			: ps.getString(keyConst));
}
 
Example 59
Project: solidity-ide   File: SolidityPreferenceInitializer.java   Source Code and License 4 votes vote down vote up
protected IPreferenceStore getPreferenceStore() {
	return SolidityActivator.getInstance().getPreferenceStore();
}
 
Example 60
Project: neoscada   File: PreferenceInitializer.java   Source Code and License 4 votes vote down vote up
@Override
public void initializeDefaultPreferences ()
{
    final IPreferenceStore store = Activator.getDefault ().getPreferenceStore ();
    store.setDefault ( PreferenceConstants.P_DEFAULT_CHUNK_SIZE, 500 );
}