PathVariableManager getWorkspaceManager() { return (PathVariableManager) resource.getWorkspace().getPathVariableManager(); }
protected final void createLinkedPathVariable(String linkedPathVariable, File archiveFile) throws CoreException { IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); IPath linkedPath = new Path(archiveFile.getAbsolutePath()); manager.setValue(linkedPathVariable, linkedPath); }
private IPathVariableManager getPathVariableManager() { if (currentResource != null) return currentResource.getPathVariableManager(); return ResourcesPlugin.getWorkspace().getPathVariableManager(); }
PathVariableManager getWorkspaceManager() { return (PathVariableManager) resource.getWorkspace().getPathVariableManager(); }
PathVariableManager getWorkspaceManager() { return (PathVariableManager) resource.getWorkspace().getPathVariableManager(); }
private boolean linkedPathExists() { String linkedPathVariable = getStringProperty(J2EEUtilityJarListImportDataModelProvider.LINKED_PATH_VARIABLE); if (linkedPathVariable == null || linkedPathVariable.trim().length() == 0) return false; IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); IPath availableJarsPath = manager.getValue(linkedPathVariable); return availableJarsPath != null; }
/** * @param resource */ public void setResource(IResource resource) { currentResource = resource; if (resource != null) pathVariableManager = resource.getPathVariableManager(); else pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); removedVariableNames = new HashSet(); tempPathVariables = new TreeMap(); // initialize internal model initTemporaryState(); }
/** * Creates a new PathVariablesGroup. * * @param multiSelect create a multi select tree * @param variableType the type of variables that are displayed in * the widget group. <code>IResource.FILE</code> and/or <code>IResource.FOLDER</code> * logically ORed together. */ public PathVariablesGroup(boolean multiSelect, int variableType) { this.multiSelect = multiSelect; this.variableType = variableType; pathVariableManager = ResourcesPlugin.getWorkspace() .getPathVariableManager(); removedVariableNames = new HashSet(); Collator ignoreCaseComparator = Collator.getInstance(); tempPathVariables = new TreeMap(ignoreCaseComparator); // initialize internal model initTemporaryState(); }
/** * @return the current IPathVariableManager */ private IPathVariableManager getPathVariableManager() { if (updatableResourceName != null && updatableResourceName.getResource() != null) return updatableResourceName.getResource().getPathVariableManager(); return ResourcesPlugin.getWorkspace().getPathVariableManager(); }
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { if (EAR_PROJECT_NAME.equals(propertyName)) { return DataModelPropertyDescriptor.createDescriptors(getValidProjectNames()); } else if (LINKED_PATH_VARIABLE.equals(propertyName)) { IPathVariableManager manager = ResourcesPlugin.getWorkspace().getPathVariableManager(); return DataModelPropertyDescriptor.createDescriptors(manager.getPathVariableNames()); } else return super.getValidPropertyDescriptors(propertyName); }
/** * */ public void setupVariableContent() { IPathVariableManager pathVariableManager; if (content.getResource() != null) pathVariableManager = content.getResource().getPathVariableManager(); else pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); String[] variables = pathVariableManager.getPathVariableNames(); ArrayList items = new ArrayList(); for (int i = 0; i < variables.length; i++) { if (variables[i].equals("PARENT")) //$NON-NLS-1$ continue; items.add(variables[i]); } items.add(IDEWorkbenchMessages.ImportTypeDialog_editVariables); variableCombo.setItems((String[]) items.toArray(new String[0])); }
/** * Stop the monitoring of resources by all monitors. */ public void stop() { workspace.removeResourceChangeListener(this); workspace.getPathVariableManager().removeChangeListener(this); // synchronized: protect the collection during iteration synchronized (registeredMonitors) { for (Iterator<IRefreshMonitor> i = registeredMonitors.keySet().iterator(); i.hasNext();) { IRefreshMonitor monitor = i.next(); monitor.unmonitor(null); } } registeredMonitors.clear(); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " stopping monitor manager."); //$NON-NLS-1$ pollMonitor.cancel(); }
/** * Stop the monitoring of resources by all monitors. */ public void stop() { workspace.removeResourceChangeListener(this); workspace.getPathVariableManager().removeChangeListener(this); // synchronized: protect the collection during iteration synchronized (registeredMonitors) { for (Iterator<IRefreshMonitor> i = registeredMonitors.keySet().iterator(); i.hasNext();) { IRefreshMonitor monitor = i.next(); monitor.unmonitor(null); } } registeredMonitors.clear(); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " stopping monitor manager."); //$NON-NLS-1$ pollMonitor.cancel(); }
/** * Tries to resolve the value entered in the link target field as * a variable, if the value is a relative path. * Displays the resolved value if the entered value is a variable. */ private String resolveVariable() { IPathVariableManager pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); IPath path= Path.fromOSString(fDependenciesGroup.getLinkTarget()); IPath resolvedPath= pathVariableManager.resolvePath(path); return resolvedPath.toOSString(); }
/** * Stop the monitoring of resources by all monitors. */ public void stop() { workspace.removeResourceChangeListener(this); workspace.getPathVariableManager().removeChangeListener(this); // synchronized: protect the collection during iteration synchronized (registeredMonitors) { for (IRefreshMonitor monitor : registeredMonitors.keySet()) { monitor.unmonitor(null); } } registeredMonitors.clear(); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " stopping monitor manager."); //$NON-NLS-1$ pollMonitor.cancel(); }
/** * Opens a path variable selection dialog */ private void handleVariablesButtonPressed() { PathVariableSelectionDialog dialog = new PathVariableSelectionDialog( getShell(), type); if (dialog.open() == IDialogConstants.OK_ID) { String[] variableNames = (String[]) dialog.getResult(); if (variableNames != null) { IPathVariableManager pathVariableManager = ResourcesPlugin .getWorkspace().getPathVariableManager(); IPath path = pathVariableManager.getValue(variableNames[0]); if (path != null) { linkTargetField.setText(path.toOSString()); } } } }
/** * Start the monitoring of resources by all monitors. */ public void start() { boolean refreshNeeded = false; for (Iterator<IResource> i = getResourcesToMonitor().iterator(); i.hasNext();) refreshNeeded |= !monitor(i.next()); workspace.getPathVariableManager().addChangeListener(this); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); //adding the lifecycle listener twice does no harm ((Workspace) workspace).addLifecycleListener(this); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting monitor manager."); //$NON-NLS-1$ //If not exclusively using polling, create a polling monitor and run it once, to catch //changes that occurred while the native monitor was turned off. if (refreshNeeded) new PollingMonitor(refreshManager).runOnce(); }
/** * Start the monitoring of resources by all monitors. */ public void start() { boolean refreshNeeded = false; for (Iterator<IResource> i = getResourcesToMonitor().iterator(); i.hasNext();) refreshNeeded |= !monitor(i.next()); workspace.getPathVariableManager().addChangeListener(this); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); //adding the lifecycle listener twice does no harm ((Workspace) workspace).addLifecycleListener(this); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting monitor manager."); //$NON-NLS-1$ //If not exclusively using polling, create a polling monitor and run it once, to catch //changes that occurred while the native monitor was turned off. if (refreshNeeded) new PollingMonitor(refreshManager).runOnce(); }
return locationStatus; IPathVariableManager pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); IPath path1= Path.fromOSString(fLinkFields.fLinkLocation.getText()); IPath resolvedPath= pathVariableManager.resolvePath(path1);
/** * Start the monitoring of resources by all monitors. * @param progressMonitor */ public void start(IProgressMonitor progressMonitor) { List<IResource> resourcesToMonitor = getResourcesToMonitor(); SubMonitor subMonitor = SubMonitor.convert(progressMonitor, resourcesToMonitor.size() + 1); boolean refreshNeeded = false; for (IResource resource : resourcesToMonitor) { refreshNeeded |= !monitor(resource, subMonitor.split(1)); } workspace.getPathVariableManager().addChangeListener(this); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); //adding the lifecycle listener twice does no harm ((Workspace) workspace).addLifecycleListener(this); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting monitor manager."); //$NON-NLS-1$ //If not exclusively using polling, create a polling monitor and run it once, to catch //changes that occurred while the native monitor was turned off. subMonitor.split(1); if (refreshNeeded) { new PollingMonitor(refreshManager).runOnce(); } }