本文整理汇总了Java中org.eclipse.gef.EditPartFactory类的典型用法代码示例。如果您正苦于以下问题:Java EditPartFactory类的具体用法?Java EditPartFactory怎么用?Java EditPartFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EditPartFactory类属于org.eclipse.gef包,在下文中一共展示了EditPartFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* init
* void
*/
private void init() {
list = new ArrayList<IUMLDiagramApplication>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IConfigurationElement config[] = registry.getConfigurationElementsFor(NEXCORE_TOOL_UML_UI_CORE_EDITOR_EXTENSION);
if (config != null) {
for (IConfigurationElement element : config) {
UMLDiagramApplication editor = new UMLDiagramApplication();
try {
editor.setFactory((EditPartFactory) element.createExecutableExtension(EXTENSION_EDIT_PART_FACTORY));
editor.setName(element.getAttribute("name"));
editor.setId(element.getAttribute("id"));
list.add(editor);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
示例2: initializeViewer
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
@Override
protected void initializeViewer(final Composite parent)
{
parent.setLayout(new FillLayout());
// Create the viewer using the supplied parent
viewer = createGraphicalViewer();
final Control c = viewer.createControl(parent);
c.setBackground(ColorConstants.white);
// Create and initialize the root edit part
final ScalableRootEditPart root = new ScalableRootEditPart();
viewer.setRootEditPart(root);
viewer.setEditDomain(new DefaultEditDomain(null));
// Create and initialize the edit part factory
final EditPartFactory factory = createEditPartFactory();
viewer.setEditPartFactory(factory);
// Register the viewer as a selection provider
getSite().setSelectionProvider(viewer);
}
示例3: createChild
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
protected EditPart createChild(Object model) {
EditPartViewer epv = getViewer();
if (epv ==null) {
epv = getViewer();
}
EditPartFactory epf = epv.getEditPartFactory();
EditPart part = epf.createEditPart(this, model);
return part;
}
示例4: initContents
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* Is called to indicate, that the contents have changed. Causes a complete update of the contents of the outline page.
*/
public void initContents() {
if (_diagramEditor.getDiagramTypeProvider() != null) {
Diagram diagram = _diagramEditor.getDiagramTypeProvider().getDiagram();
EditPartFactory treeEditPartFactory = new OutlinePartFactory();
getViewer().setEditPartFactory(treeEditPartFactory);
getViewer().setContents(diagram);
}
}
示例5: initContents
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* Is called to indicate, that the contents have changed. Causes a complete
* update of the contents of the outline page.
*/
public void initContents() {
EditPartFactory treeEditPartFactory = new PictogramsTreeEditPartFactory();
getViewer().setEditPartFactory(treeEditPartFactory);
Diagram diagram = ((DiagramEditorInput) _diagramEditor.getEditorInput()).getDiagram();
getViewer().setContents(diagram);
}
示例6: buildTimeline
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
private TimelineViewer buildTimeline(Composite composite, Object model, EditPartFactory factory) {
TimelineViewer timelineViewer = new TimelineViewer(this);
timelineViewer.setEditPartFactory(factory);
timelineViewer.setContents(model);
timelineViewer.setShowToolbar(false);
addTimelineViewer(composite, timelineViewer, -1);
timelineViewer.setHorizontalRangeModel(new SecondaryRangeModel(getHorizontalRangeModel()));
return timelineViewer;
}
示例7: getEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* Gets default edit part factory.
*/
protected EditPartFactory getEditPartFactory( )
{
if ( editPartFactoy == null )
{
editPartFactoy = new GraphicalPartFactory( );
}
return editPartFactoy;
}
示例8: getEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
private EditPartFactory getEditPartFactory() {
return new EditPartFactory() {
@Override
public EditPart createEditPart(final EditPart inContext, final Object inModel) {
if (inModel instanceof CentralAssociationsModel) {
return new RelationsEditPart((CentralAssociationsModel) inModel);
} else if (inModel instanceof ItemAdapter) {
return ItemEditPart.createItemEditPart((ItemAdapter) inModel, context);
} else if (inModel instanceof IRelation) {
return new RelationEditPart((IRelation) inModel);
}
return null;
}
};
}
示例9: getFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @return the factory
*/
public EditPartFactory getFactory() {
return factory;
}
示例10: createDiagramEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#createDiagramEditPartFactory()
*/
@Override
protected EditPartFactory createDiagramEditPartFactory() {
return new ComponentDiagramEditPartFactory();
}
示例11: createDiagramEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#createDiagramEditPartFactory()
*/
@Override
protected EditPartFactory createDiagramEditPartFactory() {
return new ActivityDiagramEditPartFactory();
}
示例12: createDiagramEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#createDiagramEditPartFactory()
*/
@Override
protected EditPartFactory createDiagramEditPartFactory() {
return new SequenceDiagramEditPartFactory();
}
示例13: createDiagramEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#createDiagramEditPartFactory()
*/
@Override
protected EditPartFactory createDiagramEditPartFactory() {
return new ClassDiagramEditPartFactory();
}
示例14: createDiagramEditPartFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#createDiagramEditPartFactory()
*/
@Override
protected EditPartFactory createDiagramEditPartFactory() {
return new UseCaseDiagramEditPartFactory();
}
示例15: createEditParFactory
import org.eclipse.gef.EditPartFactory; //导入依赖的package包/类
@Override
protected EditPartFactory createEditParFactory() {
return new ChartThemeEditPartFactory();
}