当前位置: 首页>>代码示例>>Java>>正文


Java DiagramEditor类代码示例

本文整理汇总了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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:ContentOutlinePageAdapterFactory.java

示例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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:ExtensionUtil.java

示例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();
		}
	}
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:20,代码来源:AbstractFixFlowPropertySection.java

示例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();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:ActivitiPlugin.java

示例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");
  }

}
	
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:43,代码来源:PropertyRbacSection.java

示例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");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:32,代码来源:PropertyMultiInstanceSection.java

示例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");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:41,代码来源:PropertyDiagramSection.java

示例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");
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:PropertyCustomServiceTaskSection.java

示例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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:ActivitiUiUtil.java

示例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;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:8,代码来源:FoxBPMPropertyLabelProvider.java

示例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;
	}
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:9,代码来源:AbstractFixFlowPropertySection.java

示例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;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:16,代码来源:AbstractFixFlowPropertySection.java

示例13: NewStatemachineWizard

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public NewStatemachineWizard() {
  super("State Machine Graphiti", "statemachine_graphiti", "statemachine", "statemachine", DiagramEditor.DIAGRAM_EDITOR_ID);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:4,代码来源:NewStatemachineWizard.java

示例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();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:6,代码来源:SequenceFlowSynchronizer.java

示例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);
	}

}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:61,代码来源:PropertyNtkSection.java


注:本文中的org.eclipse.graphiti.ui.editor.DiagramEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。