public void refreshText() { ClassPathSelection sel = model.getClassPathSelection(); if (sel != null && classPathText != null) classPathText.setText(sel == null ? "" : sel.toString()); //$NON-NLS-1$ }
/** * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#isDirty() */ public boolean isDirty() { ClassPathSelection selection = getClassPathSelection(); if (selection == null) return false; return selection.isModified(); }
private void initFilterLevel(int filterLevel) { model.getClassPathSelection().setFilterLevel(filterLevel); switch (filterLevel) { case (ClassPathSelection.FILTER_NONE) : useAnyJARsBtn.setSelection(true); useClientJARsBtn.setSelection(false); useServerJARsBtn.setSelection(false); break; case (ClassPathSelection.FILTER_EJB_CLIENT_JARS) : useAnyJARsBtn.setSelection(false); useClientJARsBtn.setSelection(false); useServerJARsBtn.setSelection(true); break; case (ClassPathSelection.FILTER_EJB_SERVER_JARS) : useAnyJARsBtn.setSelection(false); useClientJARsBtn.setSelection(true); useServerJARsBtn.setSelection(false); break; } }
protected ClassPathSelection getUnSelectedClassPathSelection() { ClassPathSelection selection = new ClassPathSelection(); Object[] checkedElements = tableManager.availableJARsViewer.getCheckedElements(); List modelElements = model.getClassPathSelection().getClasspathElements(); for (int i = 0; i < modelElements.size(); i++) { List checkedElementsList = Arrays.asList(checkedElements); if (!checkedElementsList.contains(modelElements.get(i))) { selection.getClasspathElements().add(modelElements.get(i)); } } return selection; }
/** * Select or deselect all and notify */ public void setAllClasspathElementsSelected(List elements, boolean selected) { ClassPathSelection s = getClassPathSelection(); if (s != null) { s.setAllSelected(elements, selected); updateManifestClasspath(); } }
public void moveUp(List toMoveUp) { getClassPathSelection().moveUp(toMoveUp); updateManifestClasspath(); }
public void selectFilterLevel(int filterLevel) { getClassPathSelection(); if (classPathSelection != null) classPathSelection.selectFilterLevel(filterLevel); updateManifestClasspath(); }
/** * Select or deselect all and notify */ public void setAllClasspathElementsSelected(boolean selected) { ClassPathSelection s = getClassPathSelection(); if (s != null) { s.setAllSelected(selected); updateManifestClasspath(); } }
public void moveDown(List toMoveDown) { getClassPathSelection().moveDown(toMoveDown); updateManifestClasspath(); }
private void initializeEJBClientDefaults() { if (model == null || model.getClassPathSelection() == null) return; boolean shouldUseServerJARs = false; ClassPathSelection selection = model.getClassPathSelection(); int filterLevel; boolean ejbSelected = selection.isAnyEJBJarSelected(); boolean clientSelected = selection.isAnyEJBClientJARSelected(); if (ejbSelected && clientSelected) filterLevel = ClassPathSelection.FILTER_NONE; else if (shouldUseServerJARs) { if (clientSelected) filterLevel = ClassPathSelection.FILTER_NONE; else filterLevel = ClassPathSelection.FILTER_EJB_CLIENT_JARS; } else { if (ejbSelected) filterLevel = ClassPathSelection.FILTER_NONE; else filterLevel = ClassPathSelection.FILTER_EJB_SERVER_JARS; } initFilterLevel(filterLevel); }
public void removeDependency(IProject referencedProject) { getClassPathSelection(); if (classPathSelection == null) return; ClasspathElement element = classPathSelection.getClasspathElement(referencedProject); if (element != null && element.isValid()) setSelection(element, false); }
public boolean selectDependencyIfNecessary(IProject referencedProject) { getClassPathSelection(); if (classPathSelection == null || classPathSelection.hasDirectOrIndirectDependencyTo(referencedProject)) return false; ClasspathElement element = classPathSelection.getClasspathElement(referencedProject); if (element != null) { setSelection(element, true); return true; } return false; }
public boolean selectDependencyIfNecessary(String jarName) { getClassPathSelection(); if (classPathSelection == null || classPathSelection.hasDirectOrIndirectDependencyTo(jarName)) return false; ClasspathElement element = classPathSelection.getClasspathElement(jarName); if (element != null) { setSelection(element, true); return true; } return false; }
public void removeDependency(String jarName) { getClassPathSelection(); if (classPathSelection == null) return; ClasspathElement element = classPathSelection.getClasspathElement(jarName); if (element != null && element.isValid()) setSelection(element, false); }
protected UpdateJavaBuildPathOperation createBuildPathOperation(ClasspathModel aModel) { IJavaProject javaProject = JemProjectUtilities.getJavaProject(aModel.getProject()); return new UpdateJavaBuildPathOperation(javaProject, aModel.getClassPathSelection()); }
protected UpdateManifestOperation createManifestOperation() { return new UpdateManifestOperation(project.getName(), model.getClassPathSelection().toString(), true); }
protected ClassPathSelection getClasspathSelection() { if (model == null || model.getSelectedEARComponent() == null && !(J2EEProjectUtilities.isStandaloneProject(model.getComponent().getProject()))) return null; return model.getClassPathSelection(); }
/** * Sets the manfest on the archive, updates the classpath selection, and notifies */ public void setManifest(ArchiveManifest newManifest) { try { J2EEProjectUtilities.writeManifest(getProject(), newManifest); } catch (IOException e) { handleOpenFailureException(e); } getClassPathSelection(); // Ensure the selection is initialized. fireNotification(new ClasspathModelEvent(ClasspathModelEvent.MANIFEST_CHANGED)); }
/** * @see org.eclipse.jface.preference.IPreferencePage#performOk() */ public boolean performOk() { if (!isDirty) return true; WorkspaceModifyComposedOperation composed = new WorkspaceModifyComposedOperation(createManifestOperation()); createClasspathAttributeUpdateOperation(composed, model.getClassPathSelection(), false); try { new ProgressMonitorDialog(propPage.getShell()).run(true, true, composed); } catch (InvocationTargetException ex) { String title = ManifestUIResourceHandler.An_internal_error_occurred_ERROR_; String msg = title; if (ex.getTargetException() != null && ex.getTargetException().getMessage() != null) msg = ex.getTargetException().getMessage(); MessageDialog.openError(propPage.getShell(), title, msg); org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); return false; } catch (InterruptedException e) { // cancelled return false; } finally { model.dispose(); } isDirty = false; return true; }
private UpdateManifestOperation createManifestOperation(ClasspathModel aModel) { IDataModel updateManifestDataModel = DataModelFactory.createDataModel(UpdateManifestDataModelProvider.class); updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, aModel.getProject().getName()); updateManifestDataModel.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false); updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.JAR_LIST, UpdateManifestDataModelProvider.convertClasspathStringToList(aModel.getClassPathSelection().toString())); updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, J2EEProjectUtilities.getManifestFile( aModel.getProject())); return new UpdateManifestOperation(updateManifestDataModel); }