本文整理汇总了Java中org.eclipse.core.internal.preferences.EclipsePreferences类的典型用法代码示例。如果您正苦于以下问题:Java EclipsePreferences类的具体用法?Java EclipsePreferences怎么用?Java EclipsePreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EclipsePreferences类属于org.eclipse.core.internal.preferences包,在下文中一共展示了EclipsePreferences类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eventReceivedPreferencesChanged
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
@Inject
@Optional
void eventReceivedPreferencesChanged(
@EventTopic("event_preferences_changed/*") final String preferencePath) {
if (preferencePath != null && preferencePath.endsWith(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS)) {
sync.asyncExec(new Runnable() {
@Override
public void run() {
Preferences rootNode = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus");
annotationSettings = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
AnnotationToolbarItemCreator.processAndUpateToolbarItemsAnnotationShortcut(part, annotationSettings);
textAnnotatationEditor.reloadCurrentSentence();
}
});
}
}
示例2: loadAnnotationPreferenceNodes
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
/**
* @return
*/
private List<EclipsePreferences> loadAnnotationPreferenceNodes() {
Preferences rootNode = ConfigurationScope.INSTANCE.getNode(Activator.BUNDLE_ID);
annotationsNode = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
List<EclipsePreferences> nodes = new Vector<EclipsePreferences>();
if (annotationsNode != null)
{
try {
for (String n : annotationsNode.childrenNames())
{
if (annotationsNode.nodeExists(n))
{
nodes.add((EclipsePreferences) annotationsNode.node(n));
}
}
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
return nodes;
}
示例3: setUp
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
@Before
public void setUp() {
eventBroker = (IEventBroker) PlatformUI.getWorkbench().getService(IEventBroker.class);
eclipsePreferences = new EclipsePreferences();
numberedBookmarks = new NumberedBookmarks(eclipsePreferences, eventBroker);
numberedBookmarks.init();
bookmarkDatabase = new BookmarkDatabase("test", createBookmarksTree());
virtualFolder = new NumberedBookmarksVirtualFolder(eventBroker, bookmarkDatabase,
bookmarkDatabase.getBookmarksTree().getRootFolder().getId(), numberedBookmarks);
}
示例4: createPartControl
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
@PostConstruct
public void createPartControl(Composite parent) {
if (parentShell == null)
{
parentShell = new Shell();
}
try {
part = partService.findPart(PART_ID);
} catch (Exception e) {
// logger.warn("Part Service couldn't find org.fuberlin.bts.ui.corpus.egy.annotations.TextAnnotationsPart ");
e.printStackTrace();
}
parent.setLayout(new GridLayout());
((GridLayout) parent.getLayout()).marginHeight = 0;
((GridLayout) parent.getLayout()).marginWidth = 0;
// contextService
// .activateContext("org.eclipse.ui.contexts.dialogAndWindow");
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(IBTSEditor.class, TextAnnotationsPart.this);
textAnnotatationEditor = ContextInjectionFactory.make(
TextAnnotationsComposite.class, child);
// load annotatin styling settings node
Preferences rootNode = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus");
annotationSettings = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
AnnotationToolbarItemCreator.processAndUpateToolbarItemsAnnotationShortcut(part, annotationSettings);
Map<String, Boolean> filters = (Map<String, Boolean>) context.get("org.bbaw.bts.corpus.annotationsPart.filter");
textAnnotatationEditor.setFilters(filters );
if (text != null)
{
loadInput(text);
}
parent.layout();
parent.pack();
constructed = true;
}
示例5: getLocation
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
public IPath getLocation() {
IProject project = ((IResource) context).getProject();
IPath location = project.getLocation();
return location == null
? null
: location.append(EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME);
}
示例6: doStore
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
protected void doStore() {
IPreferenceStore pstore = getPreferenceStore();
if (isNullAllowedAndSet()) {
if (pstore instanceof EclipsePreferences)
((EclipsePreferences) pstore).remove(getPreferenceName());
else if (pstore instanceof ScopedPreferenceStore) {
// try {
for (IEclipsePreferences ep : ((ScopedPreferenceStore) pstore).getPreferenceNodes(true))
ep.remove(getPreferenceName());
// Method m = pstore.getClass().getDeclaredMethod("getStorePreferences");
// m.setAccessible(true);
// if (m != null) {
// IEclipsePreferences ep = (IEclipsePreferences) m.invoke(pstore);
// ep.remove(getPreferenceName());
// }
// } catch (SecurityException e) {
// e.printStackTrace();
// } catch (NoSuchMethodException e) {
// e.printStackTrace();
// } catch (IllegalArgumentException e) {
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// } catch (InvocationTargetException e) {
// e.printStackTrace();
// }
} else
pstore.setValue(getPreferenceName(), null);
} else
pstore.setValue(getPreferenceName(), textField.getText());
}
示例7: ResourcePreferences
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
private ResourcePreferences(EclipsePreferences parent, String name) {
super(parent, name);
String path = absolutePath().replaceAll("/resource", "").replace(';', //$NON-NLS-1$ //$NON-NLS-2$
'/');
if (name != null) {
if (path.endsWith(name)) {
path = path.substring(0, path.length() - name.length() - 1);
qualifier = name;
}
}
if (!path.isEmpty())
pfile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path));
initialize();
}
示例8: ScopedPreferenceStoreMirroredToEclipsePreferences
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
public ScopedPreferenceStoreMirroredToEclipsePreferences(IScopeContext context, String qualifier) {
super(context, qualifier);
IEclipsePreferences preferences = context.getNode(CommonPlugin.ID);
if (preferences instanceof EclipsePreferences) {
mirrorToPreferences = (EclipsePreferences) preferences;
}
}
示例9: setUp
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
@Before
public void setUp() {
eclipsePreferences = new EclipsePreferences();
numberedBookmarks = new NumberedBookmarks(eclipsePreferences, eventBroker);
numberedBookmarks.init();
}
示例10: determineAndSetBackgroundColor
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
/**
* @param fig
* @param object
*/
private void determineAndSetBackgroundColor(AnnotationFigure fig, BTSObject object) {
// read values from the instance scope
String colorString = null;
String expandedType = processExpandedObjectType(object, true);
String parentType = null;
if (object.getSubtype() != null && !"".equals(object.getSubtype()))
{
parentType = processExpandedObjectType(object, false);
}
try {
for (String childNode : annotationSettings.childrenNames())
{
Preferences typeNode = annotationSettings.node(childNode);
String settingsTypePath = AnnotationToolbarItemCreator.getAnnotationTypePath((EclipsePreferences) typeNode);
if (settingsTypePath.equals(expandedType))
{
colorString = typeNode.get(BTSCorpusConstants.PREF_COLOR, null);
break;
} else if (settingsTypePath.equals(parentType))
{
colorString = typeNode.get(BTSCorpusConstants.PREF_COLOR, null);
}
}
} catch (BackingStoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Color color = null;
if (colorString != null)
{
color = BTSUIConstants.getColor(colorString);
}
else
{
if (object instanceof BTSComment)
{
color = BTSUIConstants.COLOR_COMMENT;
}else if (object instanceof BTSText)
{
color = BTSUIConstants.COLOR_SUBTEXT;
}else if (object instanceof BTSAnnotation)
{
if (CorpusUtils.ANNOTATION_RUBRUM_TYPE.equals(object.getType()))
{
color = BTSUIConstants.COLOR_RUBRUM;
}
else
{
color = BTSUIConstants.COLOR_ANNOTATTION;
}
}
}
if (color != null)
{
fig.setBaseBackgroundColor(color);
}
}
示例11: internalCreate
import org.eclipse.core.internal.preferences.EclipsePreferences; //导入依赖的package包/类
protected EclipsePreferences internalCreate(EclipsePreferences nodeParent, String nodeName, Object context) {
return new ResourcePreferences(nodeParent, nodeName);
}