com.google.common.collect.MapDifference.ValueDifference#org.eclipse.xtext.ui.editor.preferences.PreferenceConstants源码实例Demo

下面列出了com.google.common.collect.MapDifference.ValueDifference#org.eclipse.xtext.ui.editor.preferences.PreferenceConstants 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public boolean hasBuildAffectingChanges(Entry<String, ValueDifference<String>> preference) {
	String key = preference.getKey();
	if (key.startsWith(PREFIX)) {
		String keyName = key.substring(key.lastIndexOf(PreferenceConstants.SEPARATOR) + 1);
		switch (keyName) {
			case OUTPUT_CREATE_DIRECTORY:
			case OUTPUT_OVERRIDE:
			case OUTPUT_DERIVED:
			case OUTPUT_CLEANUP_DERIVED:
			case OUTPUT_CLEAN_DIRECTORY:
			case OUTPUT_KEEP_LOCAL_HISTORY:
				return false;
		}
	}
	return true;
}
 
源代码2 项目: sarl   文件: SARLPreferenceStoreInitializer.java
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	this.preferenceStoreAccess = preferenceStoreAccess;

	// Initialize the default visibilities for the optional issue codes.
	setupIssueCodesDefaults(preferenceStoreAccess);

	final IPreferenceStore preferenceStore = org.eclipse.jdt.ui.PreferenceConstants.getPreferenceStore();
	preferenceStore.addPropertyChangeListener(this);

	// Copy the Subword navigation from the JDT plugin.
	preferenceStoreAccess.getWritablePreferenceStore().setDefault(
			PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION,
			preferenceStore.getBoolean(org.eclipse.jdt.ui.PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION));

	// Initialize the editor preferences
	setupSourceViewerDefaults(preferenceStoreAccess);
	setupCodeminingDefaults(preferenceStoreAccess);

	// Initialize the generators for the extra languages.
	setupExtraLanguageGeneratorDefaults(preferenceStoreAccess);
}
 
源代码3 项目: xtext-eclipse   文件: XtextEditor.java
@Override
public void run() {
	// Check whether we are in a java code partition and the preference is enabled
	final IPreferenceStore store= getPreferenceStore();
	if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) {
		super.run();
		return;
	}

	final ISourceViewer viewer = getSourceViewer();
	final IDocument document = viewer.getDocument();
	try {
		fIterator.setText((CharacterIterator) new DocumentCharacterIterator(document));
		int position = widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset());
		if (position == -1)
			return;

		int next = findNextPosition(position);
		if (isBlockSelectionModeEnabled()
				&& document.getLineOfOffset(next) != document.getLineOfOffset(position)) {
			super.run(); // may navigate into virtual white space
		} else if (next != BreakIterator.DONE) {
			setCaretPosition(next);
			getTextWidget().showSelection();
			fireSelectionChanged();
		}
	} catch (BadLocationException x) {
		// ignore
	}
}
 
源代码4 项目: xtext-eclipse   文件: XtextEditor.java
@Override
public void run() {
	// Check whether we are in a java code partition and the preference is enabled
	final IPreferenceStore store= getPreferenceStore();
	if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) {
		super.run();
		return;
	}

	final ISourceViewer viewer = getSourceViewer();
	final IDocument document = viewer.getDocument();
	try {
		fIterator.setText((CharacterIterator) new DocumentCharacterIterator(document));
		int position = widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset());
		if (position == -1)
			return;

		int previous = findPreviousPosition(position);
		if (isBlockSelectionModeEnabled()
				&& document.getLineOfOffset(previous) != document.getLineOfOffset(position)) {
			super.run(); // may navigate into virtual white space
		} else if (previous != BreakIterator.DONE) {
			setCaretPosition(previous);
			getTextWidget().showSelection();
			fireSelectionChanged();
		}
	} catch (BadLocationException x) {
		// ignore - getLineOfOffset failed
	}

}
 
源代码5 项目: xtext-eclipse   文件: AbstractDetailsPart.java
@Override
protected final void addField(FieldEditor editor) {
	String prefix = null;
	if (getPreferencePrefix() != null)
		prefix = getPreferencePrefix() + PreferenceConstants.SEPARATOR + editor.getPreferenceName();
	else
		prefix = editor.getPreferenceName();
	editor.setPreferenceName(prefix);
	internalEditorsList.add(editor);
	super.addField(editor);
}
 
源代码6 项目: xtext-eclipse   文件: AbstractDetailsPart.java
private void setPreferencePrefix(String preferencePrefix) {
	this.preferencePrefix = preferencePrefix;
	for (FieldEditor fe : internalEditorsList) {
		String oldPreferenceName = fe.getPreferenceName();
		if (oldPreferenceName.indexOf(PreferenceConstants.SEPARATOR) >= 0) {
			oldPreferenceName = oldPreferenceName.substring(oldPreferenceName
					.lastIndexOf(PreferenceConstants.SEPARATOR) + 1);
		}
		fe.setPreferenceName(getPreferencePrefix() + PreferenceConstants.SEPARATOR + oldPreferenceName);
	}
}
 
源代码7 项目: xtext-xtend   文件: KeepLocalHistoryTest.java
public String getKey(final String preferenceName) {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append(EclipseOutputConfigurationProvider.OUTPUT_PREFERENCE_TAG);
  _builder.append(PreferenceConstants.SEPARATOR);
  _builder.append(IFileSystemAccess.DEFAULT_OUTPUT);
  _builder.append(PreferenceConstants.SEPARATOR);
  _builder.append(preferenceName);
  return _builder.toString();
}
 
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	this.preferenceStoreAccess = preferenceStoreAccess;

	IPreferenceStore preferenceStore = org.eclipse.jdt.ui.PreferenceConstants.getPreferenceStore();
	preferenceStore.addPropertyChangeListener(this);
	preferenceStoreAccess.getWritablePreferenceStore().setDefault(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION,
			preferenceStore.getBoolean(org.eclipse.jdt.ui.PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION));
	
}
 
@Override
public void propertyChange(PropertyChangeEvent event) {
	if (preferenceStoreAccess == null) {
		return;
	}
	if (org.eclipse.jdt.ui.PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION.equalsIgnoreCase(event.getProperty())) {
		preferenceStoreAccess.getWritablePreferenceStore().setValue(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION,
				Boolean.valueOf(event.getNewValue().toString()));
	}
}
 
源代码10 项目: sarl   文件: SARLPreferenceStoreInitializer.java
@Override
public void propertyChange(PropertyChangeEvent event) {
	if (this.preferenceStoreAccess == null) {
		return;
	}
	// Copy the Subword navigation from the JDT plugin.
	if (org.eclipse.jdt.ui.PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION.equalsIgnoreCase(event.getProperty())) {
		this.preferenceStoreAccess.getWritablePreferenceStore().setValue(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION,
				Boolean.valueOf(event.getNewValue().toString()));
	}

}
 
protected String getDefaultOutputDirectoryKey() {
	return OUTPUT_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + IFileSystemAccess.DEFAULT_OUTPUT
			+ PreferenceConstants.SEPARATOR + OUTPUT_DIRECTORY;
}
 
protected String getUseOutputPerSourceFolderKey() {
	return OUTPUT_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + IFileSystemAccess.DEFAULT_OUTPUT
			+ PreferenceConstants.SEPARATOR + USE_OUTPUT_PER_SOURCE_FOLDER;
}
 
@Override
public void initialize(IPreferenceStoreAccess access) {
	access.getWritablePreferenceStore().setDefault(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION, true);
}
 
private String calculateClientPreferencePrefix(Object object) {
	return getPreferenceName() + PreferenceConstants.SEPARATOR + identifier(object);
}
 
private String getKey(OutputConfiguration outputConfiguration, String preferenceName) {
	return OUTPUT_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + outputConfiguration.getName()
			+ PreferenceConstants.SEPARATOR + preferenceName;
}
 
private String getOutputForSourceFolder(IPreferenceStore store ,OutputConfiguration outputConfiguration, String sourceFolder) {
	String key = getKey(outputConfiguration, SOURCE_FOLDER_TAG + PreferenceConstants.SEPARATOR + sourceFolder + PreferenceConstants.SEPARATOR + OUTPUT_DIRECTORY);
	return Strings.emptyToNull(store.getString(key));
}
 
private boolean isIgnoreSourceFolder(IPreferenceStore store ,OutputConfiguration outputConfiguration, String sourceFolder) {
	String key = getKey(outputConfiguration, SOURCE_FOLDER_TAG + PreferenceConstants.SEPARATOR + sourceFolder + PreferenceConstants.SEPARATOR + IGNORE_SOURCE_FOLDER_TAG);
	return store.contains(key)? store.getBoolean(key): false;
}
 
源代码18 项目: xtext-eclipse   文件: BuilderPreferenceAccess.java
public static String getKey(OutputConfiguration outputConfiguration, String preferenceName) {
	return OUTPUT_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + outputConfiguration.getName()
			+ PreferenceConstants.SEPARATOR + preferenceName;
}
 
源代码19 项目: xtext-eclipse   文件: BuilderPreferenceAccess.java
public static String getOutputForSourceFolderKey(OutputConfiguration outputConfiguration, String sourceFolder) {
	return getKey(outputConfiguration, SOURCE_FOLDER_TAG + PreferenceConstants.SEPARATOR + sourceFolder + PreferenceConstants.SEPARATOR + OUTPUT_DIRECTORY);
}
 
源代码20 项目: xtext-eclipse   文件: BuilderPreferenceAccess.java
public static String getIgnoreSourceFolderKey(OutputConfiguration outputConfiguration, String sourceFolder) {
	return getKey(outputConfiguration, SOURCE_FOLDER_TAG + PreferenceConstants.SEPARATOR + sourceFolder + PreferenceConstants.SEPARATOR + IGNORE_SOURCE_FOLDER_TAG);
}
 
源代码21 项目: sarl   文件: ExtraLanguagePreferenceAccess.java
/** Create a preference key according to the Xtext option block standards.
 *
 * @param preferenceContainerID the identifier of the generator's preference container.
 * @param preferenceName the name of the preference.
 * @return the key.
 */
private static String getXtextKey(String preferenceContainerID, String preferenceName) {
	return GENERATOR_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + preferenceContainerID
			+ PreferenceConstants.SEPARATOR + preferenceName;
}