Java 类org.eclipse.gef.requests.CreationFactory 实例源码

项目:ForgedUI-Eclipse    文件:MyTemplateTransferDropTargetListener.java   
@Override
protected CreationFactory getFactory(Object template) {
    if (template instanceof Element) {
        //how this happened???
        return new TitaniumUIElementFactory(
                (Class<? extends Element>) template.getClass(), diagram);

    } else if (template instanceof Class){
        if (Element.class.isAssignableFrom((Class<?>) template)){
            return new TitaniumUIElementFactory(
                    (Class<? extends Element>) template, diagram);
        }

    }
    throw new IllegalArgumentException("Can't create factory for " + template);
}
项目:seg.jUCMNav    文件:PathTool.java   
/**
 * This function is called to return a factory for our create request. A factory is returned depending on the state of the tool.
 * 
 * (non-Javadoc)
 * 
 * @see org.eclipse.gef.tools.CreationTool#getFactory()
 */
protected CreationFactory getFactory() {
    ModelCreationFactory factory;
    switch (state) {
    case ENDPOINT:
        factory = new ModelCreationFactory(getURNspec(), EndPoint.class);
        break;
    case STARTPOINT:
        factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
        break;
    case NOSELECT:
        factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
        break;
    case CONNECTION:
        factory = new ModelCreationFactory(getURNspec(), EmptyPoint.class);
        break;
    default:
        factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
    }

    return factory;
}
项目:Hydrograph    文件:ELTGraphicalEditor.java   
/**
 * Create a transfer drop target listener. When using a
 * CombinedTemplateCreationEntry tool in the palette, this will enable model
 * element creation by dragging from the palette.
 * 
 * @see #createPaletteViewerProvider()
 */
public TransferDropTargetListener createTransferDropTargetListener() {
    return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
        @Override
        protected CreationFactory getFactory(Object template) {
            return new SimpleFactory((Class) template);
        }
    };
}
项目:bdf2    文件:DbToolGefEditor.java   
private TransferDropTargetListener createTransferDropTargetListener() {
    return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
        protected CreationFactory getFactory(Object template) {
            return new SimpleFactory((Class<?>) template);
        }
    };
}
项目:gef-gwt    文件:CreationTool.java   
/**
 * @see org.eclipse.gef.tools.AbstractTool#applyProperty(java.lang.Object,
 *      java.lang.Object)
 */
protected void applyProperty(Object key, Object value) {
    if (PROPERTY_CREATION_FACTORY.equals(key)) {
        if (value instanceof CreationFactory)
            setFactory((CreationFactory) value);
        return;
    }
    super.applyProperty(key, value);
}
项目:gef-gwt    文件:AbstractConnectionCreationTool.java   
protected void applyProperty(Object key, Object value) {
    if (CreationTool.PROPERTY_CREATION_FACTORY.equals(key)) {
        if (value instanceof CreationFactory)
            setFactory((CreationFactory) value);
        return;
    }
    super.applyProperty(key, value);
}
项目:eclipsensis    文件:InstallOptionsTemplateCreationTool.java   
@Override
public void setFactory(CreationFactory factory)
{
    if(factory instanceof InstallOptionsTemplateCreationFactory) {
        super.setFactory(factory);
    }
}
项目:birt    文件:CommandCombinedTemplateCreationEntry.java   
public PaletteEntryCreationTool( CreationFactory factory,
        PaletteEntryExtension paletteEntry )
{
    super( factory, null );
    this.factory = factory;
    setFactory( factory );
    this.paletteEntry = paletteEntry;
}
项目:birt    文件:ReportTemplateTransferDropTargetListener.java   
protected CreationFactory getFactory( Object template )
{
    if ( handleValidateDrag( template ) )
    {
        if ( template instanceof String )
        {
            return new ReportElementFactory( template );
        }
        return new ReportElementFactory( getSingleTransferData( template ),
                template );
    }
    return null;
}
项目:birt    文件:ReportCreationTool.java   
/**
 * Constructor
 * 
 * @param factory
 * @param preHandle
 */
public ReportCreationTool( CreationFactory factory,
        AbstractToolHandleExtends preHandle )
{
    super( factory );
    this.preHandle = preHandle;
}
项目:seg.jUCMNav    文件:UrnDropTargetListener.java   
public CreationFactory getFactory(Object template) {
    setEnablementDeterminedByCommand(true);

    if (template instanceof CreationFactory)
        return (CreationFactory) template;
    else
        return new ModelCreationFactory(urn, (Class) template);
}
项目:lunifera-sharky-m2m    文件:ShapesEditor.java   
/**
 * Create a transfer drop target listener. When using a
 * CombinedTemplateCreationEntry tool in the palette, this will enable model
 * element creation by dragging from the palette.
 * 
 * @see #createPaletteViewerProvider()
 */
private TransferDropTargetListener createTransferDropTargetListener() {
    return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
        protected CreationFactory getFactory(Object template) {
            return new SimpleFactory((Class) template);
        }
    };
}
项目:lunifera-sharky-m2m    文件:ShapesEditor.java   
/**
 * Create a transfer drop target listener. When using a
 * CombinedTemplateCreationEntry tool in the palette, this will enable model
 * element creation by dragging from the palette.
 * 
 * @see #createPaletteViewerProvider()
 */
private TransferDropTargetListener createTransferDropTargetListener() {
    return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
        protected CreationFactory getFactory(Object template) {
            return new SimpleFactory((Class) template);
        }
    };
}
项目:NEXCORE-UML-Modeler    文件:ConnectionCreationToolWithAdditionalInformation.java   
/**
 * @param factory
 */
public ConnectionCreationToolWithAdditionalInformation(CreationFactory factory) {
    super(factory);
}
项目:NEXCORE-UML-Modeler    文件:LifeLineCreationToolWithAdditionalInformation.java   
/**
 * @param factory
 */
public LifeLineCreationToolWithAdditionalInformation(CreationFactory factory) {
    super(factory);
}
项目:PDFReporter-Studio    文件:JDCreationTool.java   
public JDCreationTool(CreationFactory aFactory) {
    super(aFactory);
}
项目:PDFReporter-Studio    文件:JSSTemplateTransferDropTargetListener.java   
@Override
protected CreationFactory getFactory(Object template) {
    return new JDPaletteCreationFactory(template);
}
项目:FRaMED    文件:CreationConstraintToolEntry.java   
public CreationConstraintToolEntry(String label, String shortDesc,
        CreationFactory factory, ImageDescriptor iconSmall,
        ImageDescriptor iconLarge, int typeValue) {
    super(label, shortDesc, factory, iconSmall, iconLarge);
    this.typeValue = typeValue;
}
项目:birt    文件:DesignerPaletteFactory.java   
public QuickToolsCombinedTemplateCreationEntry(String label, String shortDesc,
        Object template, CreationFactory factory,
        ImageDescriptor iconSmall, ImageDescriptor iconLarge) 
{
    super(label, shortDesc,template,  factory, iconSmall, iconLarge);
}
项目:wt-studio    文件:DiagramTemplateTransferDropTargetListener.java   
protected CreationFactory getFactory(Object template)
{
    return new ElementFactory(template);
}
项目:wt-studio    文件:DiagramTemplateTransferDropTargetListener.java   
protected CreationFactory getFactory(Object template)
{
    return new ElementFactory(template);
}
项目:wt-studio    文件:DiagramTemplateTransferDropTargetListener.java   
protected CreationFactory getFactory(Object template)
{
    return new ElementFactory(template);
}
项目:seg.jUCMNav    文件:URNElementCreationTool.java   
/**
 *  
 */
public URNElementCreationTool(CreationFactory factory) {
    super(factory);

    setUnloadWhenFinished(false);
}
项目:seg.jUCMNav    文件:BaseCreationTool.java   
public BaseCreationTool(CreationFactory factory) {
    super(factory);
}
项目:seg.jUCMNav    文件:BaseConnectionCreationToolEntry.java   
public BaseConnectionCreationToolEntry(String label, String shortDesc, CreationFactory factory, ImageDescriptor iconSmall, ImageDescriptor iconLarge) {
    super(label, shortDesc, factory, iconSmall, iconLarge);
}
项目:seg.jUCMNav    文件:BaseConnectionCreationToolEntry.java   
public Tool createTool() {
    return new BaseConnectionCreationTool((CreationFactory)getToolProperty(CreationTool.PROPERTY_CREATION_FACTORY));
}
项目:seg.jUCMNav    文件:BaseConnectionCreationTool.java   
public BaseConnectionCreationTool(CreationFactory factory) {
    super(factory);
}
项目:seg.jUCMNav    文件:URNElementCreationEntry.java   
public URNElementCreationEntry(String label, String shortDesc, Object template, CreationFactory factory, ImageDescriptor iconSmall,
        ImageDescriptor iconLarge) {
    super(label, shortDesc, template, /* factory */null, iconSmall, iconLarge);
    myFactory = factory;
}
项目:seg.jUCMNav    文件:URNElementCreationEntry.java   
public void setFactory(CreationFactory factory) {
    this.myFactory = factory;
}
项目:gef-gwt    文件:CreationToolEntry.java   
/**
 * Constructor for CreationToolEntry.
 * 
 * @param label
 *            the label
 * @param shortDesc
 *            the description
 * @param factory
 *            the CreationFactory
 * @param iconSmall
 *            the small icon
 * @param iconLarge
 *            the large icon
 */
public CreationToolEntry(String label, String shortDesc,
        CreationFactory factory, ImageDescriptor iconSmall,
        ImageDescriptor iconLarge) {
    super(label, shortDesc, iconSmall, iconLarge, CreationTool.class);
    this.factory = factory;
    setToolProperty(CreationTool.PROPERTY_CREATION_FACTORY, factory);
}
项目:gef-gwt    文件:ConnectionCreationToolEntry.java   
/**
 * Constructor for ConnectionCreationToolEntry.
 * 
 * @param label
 *            the label
 * @param shortDesc
 *            the description
 * @param factory
 *            the CreationFactory
 * @param iconSmall
 *            the small icon
 * @param iconLarge
 *            the large icon
 */
public ConnectionCreationToolEntry(String label, String shortDesc,
        CreationFactory factory, ImageDescriptor iconSmall,
        ImageDescriptor iconLarge) {
    super(label, shortDesc, factory, iconSmall, iconLarge);
    setToolClass(ConnectionCreationTool.class);
    setUserModificationPermission(PERMISSION_NO_MODIFICATION);
}
项目:gef-gwt    文件:CombinedTemplateCreationEntry.java   
/**
 * Constructs an entry with the given creation factory and template. The
 * creation factory is used by the creation tool when the entry is selected.
 * The template is used with the
 * {@link org.eclipse.gef.dnd.TemplateTransferDragSourceListener}.
 * 
 * @since 3.2
 * @param label
 *            the label
 * @param shortDesc
 *            the descriptoin
 * @param template
 *            the template object
 * @param factory
 *            the CreationFactory
 * @param iconSmall
 *            the small icon
 * @param iconLarge
 *            the large icon
 */
public CombinedTemplateCreationEntry(String label, String shortDesc,
        Object template, CreationFactory factory,
        ImageDescriptor iconSmall, ImageDescriptor iconLarge) {
    super(label, shortDesc, factory, iconSmall, iconLarge);
    setTemplate(template);
}
项目:gef-gwt    文件:TemplateTransferDropTargetListener.java   
/**
 * Returns the appropriate Factory object to be used for the specified
 * template. This Factory is used on the CreateRequest that is sent to the
 * target EditPart.
 * 
 * @param template
 *            the template Object
 * @return a Factory
 */
protected CreationFactory getFactory(Object template) {
    if (template instanceof CreationFactory) {
        return ((CreationFactory) template);
    } else if (template instanceof Class) {
        return new SimpleFactory((Class) template);
    } else
        return null;
}
项目:birt    文件:ReportCombinedTemplateCreationEntry.java   
/**
 * Constructor.
 * 
 * @param label
 * @param shortDesc
 * @param template
 * @param factory
 * @param iconSmall
 * @param iconLarge
 */
public ReportCombinedTemplateCreationEntry( String label, String shortDesc,
        Object template, CreationFactory factory,
        ImageDescriptor iconSmall, ImageDescriptor iconLarge,
        AbstractToolHandleExtends preHandle )
{
    super( label, shortDesc, template, factory, iconSmall, iconLarge );
    this.preHandle = preHandle;
}
项目:PDFReporter-Studio    文件:ACreateAction.java   
/**
 * Sets the creation factory.
 * 
 * @param creationFactory
 *          the new creation factory
 */
public void setCreationFactory(CreationFactory creationFactory) {
    this.creationFactory = creationFactory;
}
项目:gef-gwt    文件:CombinedTemplateCreationEntry.java   
/**
 * Constructs an entry with the given creation factory. The creation factory
 * is also used as the template object.
 * 
 * @param label
 *            the label
 * @param shortDesc
 *            the description
 * @param factory
 *            the creation factory and template
 * @param iconSmall
 *            the small icon
 * @param iconLarge
 *            the large icon
 * @since 3.2
 */
public CombinedTemplateCreationEntry(String label, String shortDesc,
        CreationFactory factory, ImageDescriptor iconSmall,
        ImageDescriptor iconLarge) {
    this(label, shortDesc, factory, factory, iconSmall, iconLarge);
}
项目:gef-gwt    文件:ConnectionDragCreationTool.java   
/**
 * Constructs a new ConnectionDragCreationTool with the given factory.
 * 
 * @param factory
 *            the creation factory
 */
public ConnectionDragCreationTool(CreationFactory factory) {
    setFactory(factory);
}
项目:gef-gwt    文件:CreationTool.java   
/**
 * Constructs a new CreationTool with the given factory.
 * 
 * @param aFactory
 *            the creation factory
 */
public CreationTool(CreationFactory aFactory) {
    this();
    setFactory(aFactory);
}
项目:gef-gwt    文件:CreationTool.java   
/**
 * Returns the creation factory used to create the new EditParts.
 * 
 * @return the creation factory
 */
protected CreationFactory getFactory() {
    return factory;
}
项目:gef-gwt    文件:CreationTool.java   
/**
 * Sets the creation factory used to create the new edit parts.
 * 
 * @param factory
 *            the factory
 */
public void setFactory(CreationFactory factory) {
    this.factory = factory;
}