本文整理汇总了Java中org.eclipse.graphiti.ui.editor.DiagramEditor类的典型用法代码示例。如果您正苦于以下问题:Java DiagramEditor类的具体用法?Java DiagramEditor怎么用?Java DiagramEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DiagramEditor类属于org.eclipse.graphiti.ui.editor包,在下文中一共展示了DiagramEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAdapter
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
if (GFPreferences.getInstance().isGenericOutlineActive()) {
if (IContentOutlinePage.class.equals(adapterType)) {
if (adaptableObject instanceof DiagramEditor) {
DiagramEditor diagramEditor = (DiagramEditor) adaptableObject;
if (diagramEditor.getConfigurationProvider() != null) { // diagram editor initialized?
GraphicsEditorOutlinePage outlinePage = new GraphicsEditorOutlinePage(new TreeViewer(), diagramEditor
.getGraphicalViewer(), diagramEditor.getActionRegistryInternal(), diagramEditor.getEditDomain(),
diagramEditor.getCommonKeyHandler(), diagramEditor.getAdapter(ZoomManager.class), diagramEditor
.getSelectionSynchronizerInternal(), diagramEditor);
return outlinePage;
}
}
}
}
return null;
}
示例2: getCustomServiceTasks
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
* Gets a list of {@link CustomServiceTask} objects based on the
* {@link TabbedPropertySheetPage} provided.
*
* @param tabbedPropertySheetPage
* the property sheet page linked to a diagram in a project that has
* {@link CustomServiceTask}s defined
* @return a list of all {@link CustomServiceTask}s or an empty list if none
* were found
*/
public static List<CustomServiceTask> getCustomServiceTasks(final TabbedPropertySheetPage tabbedPropertySheetPage) {
// Determine the part the property sheet page is in
final IWorkbenchPart part = tabbedPropertySheetPage.getSite().getWorkbenchWindow().getPartService().getActivePart();
// If the part is a diagram editor, get the project from the diagram
if (part instanceof DiagramEditor) {
final DiagramEditor editor = (DiagramEditor) part;
final IProject project = ActivitiUiUtil.getProjectFromDiagram(editor.getDiagramTypeProvider().getDiagram());
// Determine the custom service tasks using the project found
return getCustomServiceTasks(project);
}
return null;
}
示例3: refresh
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void refresh() {
EObject be = getBusinessObjectForSelection(getSelection());
if (be!=null) {
AbstractFixFlowComposite sectionRoot = getSectionRoot();
if (sectionRoot!=null) {
if (sectionRoot.getBusinessObject() != be) {
sectionRoot.setDiagramEditor((DiagramEditor) getDiagramEditor());
if (!parent.isLayoutDeferred())
parent.setLayoutDeferred(true);
sectionRoot.setBusinessObject(be);
if (parent.isLayoutDeferred())
parent.setLayoutDeferred(false);
}
sectionRoot.refresh();
}
}
}
示例4: start
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
* This method is called upon plug-in activation.
*
* @param context
* the context
*
* @throws Exception
* the exception
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
IAdapterManager manager = Platform.getAdapterManager();
manager.registerAdapters(new ContentOutlinePageAdapterFactory(), DiagramEditor.class);
// Initialize the image cache
imageCache = new ImageCache();
}
示例5: removePressed
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
* Notifies that the Remove button has been pressed.
*/
private void removePressed() {
PictogramElement pe = getSelectedPictogramElement();
if (pe != null) {
Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
if (bo instanceof Activity) {
DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
ActivitiUiUtil.runModelChange(new Runnable() {
public void run() {
Object bobj = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(getSelectedPictogramElement());
if (bobj == null) {
return;
}
else{
//get the selected action
Activity activity= (Activity)bobj;
List<ActivityAction> availableActions =activity.getActivityActions();
for(TableItem temp:table.getItems()){
if(temp.getChecked()){
for(ActivityAction aa:availableActions){
if(temp.getText(3).equals(aa.getActionName())){
aa.getPermissions().remove(0);
activity.getActivityActions().remove(aa);
break;
}
}
}
}
displayPermissions(activity);
}
}
}, editingDomain, "Model Update");
}
}
}
示例6: focusLost
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void focusLost(final FocusEvent e) {
PictogramElement pe = getSelectedPictogramElement();
if (pe == null) return;
Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
if (bo instanceof Activity == false) return;
final Activity activity = (Activity) bo;
DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
ActivitiUiUtil.runModelChange(new Runnable() {
public void run() {
if (loopCardinaltyText.getText() != null) {
getMultiInstanceDef(activity).setLoopCardinality(loopCardinaltyText.getText());
}
if (collectionText.getText() != null) {
getMultiInstanceDef(activity).setInputDataItem(collectionText.getText());
}
if (elementVariableText.getText() != null) {
getMultiInstanceDef(activity).setElementVariable(elementVariableText.getText());
}
if (completionConditionText.getText() != null) {
getMultiInstanceDef(activity).setCompletionCondition(completionConditionText.getText());
}
}
}, editingDomain, "Model Update");
}
示例7: focusLost
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void focusLost(final FocusEvent e) {
DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
ActivitiUiUtil.runModelChange(new Runnable() {
public void run() {
org.eclipse.bpmn2.Process process = ActivitiUiUtil.getProcessObject(getDiagram());
if (process == null) {
return;
}
String id = idText.getText();
if (id != null) {
process.setId(id);
} else {
process.setId("");
}
String name = nameText.getText();
if (name != null) {
process.setName(name);
} else {
process.setName("");
}
String namespace = namespaceText.getText();
if (namespace != null) {
process.setNamespace(namespace);
} else {
process.setNamespace("");
}
String documentation = documentationText.getText();
if (documentation != null) {
process.getDocumentation().get(0).setText(documentation);
} else {
process.getDocumentation().get(0).setText("");
}
}
}, editingDomain, "Model Update");
}
示例8: runModelChange
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void runModelChange(final Runnable runnable) {
PictogramElement pe = getSelectedPictogramElement();
if (pe != null) {
Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
if (bo instanceof ServiceTask) {
DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
ActivitiUiUtil.runModelChange(runnable, editingDomain, "Model Update");
}
}
}
示例9: getActionRegistry
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
* Gets the {@link ActionRegistry} for the currently active editor.
*
* @return the ActionRegistry or null
*/
public static final ActionRegistry getActionRegistry() {
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
if (part instanceof DiagramEditor) {
DiagramEditor editor = (DiagramEditor) part;
return editor.getActionRegistryInternal();
}
return null;
}
示例10: getTargetRuntime
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
private TargetRuntime getTargetRuntime(EObject object) {
DiagramEditor editor = ModelUtil.getDiagramEditor(object);
if (editor!=null) {
return (TargetRuntime) editor.getAdapter(TargetRuntime.class);
}
return null;
}
示例11: setInput
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void setInput(IWorkbenchPart part, ISelection selection) {
super.setInput(part, selection);
Object bpmn2Editor = part.getAdapter(DiagramEditor.class);
if (bpmn2Editor instanceof DiagramEditor) {
editor = (DiagramEditor)bpmn2Editor;
}
}
示例12: appliesTo
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
if (part instanceof ContentOutline) {
ContentOutline outline = (ContentOutline)part;
IContributedContentsView v = (IContributedContentsView)outline.getAdapter(IContributedContentsView.class);
if (v!=null)
part = v.getContributingPart();
}
editor = (DiagramEditor)part.getAdapter(DiagramEditor.class);
if (editor!=null) {
return true;
}
return false;
}
示例13: NewStatemachineWizard
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public NewStatemachineWizard() {
super("State Machine Graphiti", "statemachine_graphiti", "statemachine", "statemachine", DiagramEditor.DIAGRAM_EDITOR_ID);
}
示例14: SyncObjects
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
protected SyncObjects(final Connection connection, final DiagramEditor diagramEditor) {
this.graphicalRepresentation = connection;
this.diagramEditor = diagramEditor;
setup();
}
示例15: refresh
import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void refresh() {
// try to get the roles if combo is still empty
if (roleCombo.getItems().length == 0) {
for (Role role : SecurityUtil.getRoles(getDiagram())) {
roleCombo.add(role.getName());
}
}
// update task IO specifications
System.out.print("[SCVM-BPMN] updating task IO specifications...");
final Diagram diagram = getDiagram();
DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
TransactionalEditingDomain editingDomain = diagramEditor
.getEditingDomain();
ActivitiUiUtil.runModelChange(new Runnable() {
public void run() {
final List<Task> tasks = new ArrayList<Task>();
for (EObject obj : diagram.eResource().getContents()) {
if (obj instanceof Task) {
tasks.add((Task) obj);
}
}
for (Task t : tasks) {
NeedToKnowUtil.updateIOSpecification(t, diagram);
}
}
}, editingDomain, "Model Update");
System.out.println("done!");
// refresh process variable combo box
List<String> accessedProcessVariables = new ArrayList<String>();
;
PictogramElement pe = getSelectedPictogramElement();
if (pe != null) {
Object bo = Graphiti.getLinkService()
.getBusinessObjectForLinkedPictogramElement(pe);
if (bo instanceof UserTask) {
accessedProcessVariables = NeedToKnowUtil
.getAccessedProcessVariableNames((UserTask) bo);
updateTable((Activity) bo);
} else if (bo instanceof ServiceTask) {
accessedProcessVariables = NeedToKnowUtil
.getAccessedProcessVariableNames((ServiceTask) bo);
updateTable((Activity) bo);
}
} else {
return;
}
processVariableCombo.removeAll();
for (String processVariableName : accessedProcessVariables) {
processVariableCombo.add(processVariableName);
}
}