blob: f3efb92a27c1de96df24412779e82cb4405bf7b7 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2009 Jingwen Ou and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jingwen Ou - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.sandbox.ui.editors;
import java.util.Set;
import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
/**
* A bugzilla task editor page that has wiki facilities.
*
* @author Jingwen Ou
*/
public class ExtensibleBugzillaTaskEditorPage extends BugzillaTaskEditorPage {
public ExtensibleBugzillaTaskEditorPage(TaskEditor editor) {
super(editor);
}
@Override
protected Set<TaskEditorPartDescriptor> createPartDescriptors() {
Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors();
boolean hasPartNewComment = false;
for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) {
if (taskEditorPartDescriptor.getId().equals(ID_PART_NEW_COMMENT)) {
descriptors.remove(taskEditorPartDescriptor);
hasPartNewComment = true;
break;
}
}
if (hasPartNewComment) {
descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
@Override
public AbstractTaskEditorPart createPart() {
return new ExtensibleTaskEditorNewCommentPart();
}
}.setPath(PATH_COMMENTS));
}
return descriptors;
}
}