/** * This implementation of the corresponding {@link BundleActivator} method * opens the workspace. * @see BundleActivator#start(BundleContext) */ @Override public void start(BundleContext context) throws Exception { super.start(context); // register debug options listener Hashtable<String, String> properties = new Hashtable<>(2); properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PI_RESOURCES); debugRegistration = context.registerService(DebugOptionsListener.class, Policy.RESOURCES_DEBUG_OPTIONS_LISTENER, properties); if (!new LocalMetaArea().hasSavedWorkspace()) { constructWorkspace(); } // Remember workspace before opening, to // make it easier to debug cases where open() is failing. workspace = new Workspace(); PlatformURLResourceConnection.startup(workspace.getRoot().getLocation()); initializePreferenceLookupOrder(); IStatus result = workspace.open(null); if (!result.isOK()) getLog().log(result); workspaceRegistration = context.registerService(IWorkspace.class, workspace, null); }
/** * This implementation of the corresponding {@link BundleActivator} method * opens the workspace. * @see BundleActivator#start(BundleContext) */ @Override public void start(BundleContext context) throws Exception { super.start(context); // register debug options listener Hashtable<String, String> properties = new Hashtable<>(2); properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PI_RESOURCES); debugRegistration = context.registerService(DebugOptionsListener.class, Policy.RESOURCES_DEBUG_OPTIONS_LISTENER, properties); if (!new LocalMetaArea().hasSavedWorkspace()) { constructWorkspace(); } // Remember workspace before opening, to // make it easier to debug cases where open() is failing. workspace = new Workspace(); PlatformURLResourceConnection.startup(workspace.getRoot().getLocation()); initializePreferenceLookupOrder(); IStatus result = workspace.open(null); if (!result.isOK()) getLog().log(result); workspaceRegistration = context.registerService(IWorkspace.class, workspace, null); }
/** * This implementation of the corresponding {@link BundleActivator} method * opens the workspace. * @see BundleActivator#start(BundleContext) */ @Override public void start(BundleContext context) throws Exception { super.start(context); // register debug options listener Hashtable<String, String> properties = new Hashtable<>(2); properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PI_RESOURCES); debugRegistration = context.registerService(DebugOptionsListener.class, Policy.RESOURCES_DEBUG_OPTIONS_LISTENER, properties); if (!new LocalMetaArea().hasSavedWorkspace()) { constructWorkspace(); } // Remember workspace before opening, to // make it easier to debug cases where open() is failing. workspace = new Workspace(); PlatformURLResourceConnection.startup(workspace.getRoot().getLocation()); initializePreferenceLookupOrder(); IStatus result = workspace.open(null); if (!result.isOK()) getLog().log(result); workspaceRegistration = context.registerService(IWorkspace.class, workspace, null); checkMissingNaturesListener = new CheckMissingNaturesListener(); workspace.addResourceChangeListener(checkMissingNaturesListener, IResourceChangeEvent.POST_CHANGE); InstanceScope.INSTANCE.getNode(PI_RESOURCES).addPreferenceChangeListener(checkMissingNaturesListener); }