private void validatePage() { String errorMessage = null; String newText = fWorkingSetName.getText(); if (newText.trim().length() == 0) { errorMessage = PDEUIMessages.PluginWorkingSet_emptyName; if (fFirstCheck) { setPageComplete(false); fFirstCheck = false; return; } } if (errorMessage == null && fTree.getCheckboxTreeViewer().getCheckedElements().length == 0) { errorMessage = PDEUIMessages.PluginWorkingSet_noPluginsChecked; } if (errorMessage == null && fWorkingSet == null) { IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets(); for (int i = 0; i < workingSets.length; i++) { if (newText.equals(workingSets[i].getName())) { errorMessage = PDEUIMessages.PluginWorkingSet_nameInUse; break; } } } setErrorMessage(errorMessage); setPageComplete(errorMessage == null); }
private void handleFilter() { boolean changed = false; String newFilter; if (fFilterText == null || (newFilter = fFilterText.getText().trim()).length() == 0) newFilter = "*"; // $NON-NLS-1$ changed = fAvailableFilter.setPattern(newFilter); if (changed) { fAvailableListViewer.refresh(); updateButtonEnablement(false, false); } }
/* (non-Javadoc) * @see org.eclipse.ui.dialogs.IWorkingSetPage#finish() */ public void finish() { Object[] checked = fTree.getCheckboxTreeViewer().getCheckedElements(); ArrayList<PersistablePluginObject> list = new ArrayList<PersistablePluginObject>(); for (int i = 0; i < checked.length; i++) { String id = ((IPluginModelBase) checked[i]).getPluginBase().getId(); if (id != null && id.length() > 0) list.add(new PersistablePluginObject(id)); } PersistablePluginObject[] objects = list.toArray(new PersistablePluginObject[list.size()]); String workingSetName = fWorkingSetName.getText().trim(); if (fWorkingSet == null) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); fWorkingSet = workingSetManager.createWorkingSet(workingSetName, objects); } else { fWorkingSet.setName(workingSetName); fWorkingSet.setElements(objects); } }
/** Gets the model name of the new file */ @Override public String getDescription() { return descriptionText.getText(); }
/** Gets the model name of the new file */ public String getModelName() { return titleText.getText(); }
/** Gets the author of the new file */ public String getAuthor() { return authorText.getText(); }
/** Gets the file name of the new file */ public String getFileName() { return fileText.getText(); }
/** Gets the container name of the new file */ public String getContainerName() { // TODO user has to select a project otherwise it doesn't work return containerText.getText(); }
public String getComment() { return txtComment.getText(); }
public String getAbbrev() { return txtAbbrev.getText(); }
public String getName() { return txtName.getText(); }
/* (non-Javadoc) * @see org.eclipse.jface.wizard.WizardPage#isPageComplete() */ public boolean isPageComplete() { if (fNameText.getText().trim().length() == 0) return false; return true; }