blob: c68778101b5bccd19b6360f7cfc95a110c25c3b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*******************************************************************************
* Copyright (c) 2011, 2012 Red Hat, Inc.
* All rights reserved.
* This program is 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:
* Red Hat, Inc. - initial API and implementation
*
* @author Bob Brodt
******************************************************************************/
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
import org.eclipse.bpmn2.modeler.core.model.ModelDecorator;
import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskPropertySection;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
/**
* @author Bob Brodt
*
*/
public class JbpmTaskPropertySection extends TaskPropertySection {
@Override
public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
if (super.appliesTo(part, selection)) {
EObject be = getBusinessObjectForSelection(selection);
if (Bpmn2Package.eINSTANCE.getTask().isInstance(be)) {
return ModelDecorator.getAnyAttribute(be, "displayName") == null;
}
}
return false;
}
@Override
protected AbstractDetailComposite createSectionRoot() {
return new JbpmTaskDetailComposite(this);
}
@Override
public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
return new JbpmTaskDetailComposite(parent,style);
}
}
|