public ExclusionInclusionEntryDialog( Shell parent, boolean isExclusion, String patternToEdit, List existingPatterns, CPListElement entryToEdit) { super(parent); fIsExclusion = isExclusion; fExistingPatterns = existingPatterns; String title, message; if (isExclusion) { if (patternToEdit == null) { title = NewWizardMessages.ExclusionInclusionEntryDialog_exclude_add_title; } else { title = NewWizardMessages.ExclusionInclusionEntryDialog_exclude_edit_title; } message = Messages.format( NewWizardMessages.ExclusionInclusionEntryDialog_exclude_pattern_label, BasicElementLabels.getPathLabel(entryToEdit.getPath(), false)); } else { if (patternToEdit == null) { title = NewWizardMessages.ExclusionInclusionEntryDialog_include_add_title; } else { title = NewWizardMessages.ExclusionInclusionEntryDialog_include_edit_title; } message = Messages.format( NewWizardMessages.ExclusionInclusionEntryDialog_include_pattern_label, BasicElementLabels.getPathLabel(entryToEdit.getPath(), false)); } setTitle(title); if (patternToEdit != null) { fExistingPatterns.remove(patternToEdit); } IWorkspaceRoot root = entryToEdit.getJavaProject().getProject().getWorkspace().getRoot(); IResource res = root.findMember(entryToEdit.getPath()); if (res instanceof IContainer) { fCurrSourceFolder = (IContainer) res; } fExclusionPatternStatus = new StatusInfo(); ExclusionPatternAdapter adapter = new ExclusionPatternAdapter(); fExclusionPatternDialog = new StringButtonDialogField(adapter); fExclusionPatternDialog.setLabelText(message); fExclusionPatternDialog.setButtonLabel( NewWizardMessages.ExclusionInclusionEntryDialog_pattern_button); fExclusionPatternDialog.setDialogFieldListener(adapter); fExclusionPatternDialog.enableButton(fCurrSourceFolder != null); if (patternToEdit == null) { fExclusionPatternDialog.setText(""); // $NON-NLS-1$ } else { fExclusionPatternDialog.setText(patternToEdit.toString()); } }
public int hashCode() { return fKey.hashCode() * 89 + fParent.getPath().hashCode(); }
public boolean equals(Object obj) { if (!(obj instanceof CPListElementAttribute)) return false; CPListElementAttribute attrib = (CPListElementAttribute) obj; return attrib.fKey == this.fKey && attrib.getParent().getPath().equals(fParent.getPath()); }