Package org.locationtech.udig.project.element

Examples of org.locationtech.udig.project.element.ProjectElementAdapter


     */
    @Override
    protected T doSwitch(int classifierID, EObject theEObject) {
        switch (classifierID) {
        case ElementPackage.PROJECT_ELEMENT_ADAPTER: {
            ProjectElementAdapter projectElementAdapter = (ProjectElementAdapter) theEObject;
            T result = caseProjectElementAdapter(projectElementAdapter);
            if (result == null)
                result = caseProjectElement(projectElementAdapter);
            if (result == null)
                result = caseIProjectElement(projectElementAdapter);
View Full Code Here


        return ElementPackage.eINSTANCE;
    }

    public ProjectElementAdapter createProjectElementAdapter(IProject project,
            Class<? extends IGenericProjectElement> typeToCreate, String extensionId) {
        ProjectElementAdapter adapter = createProjectElementAdapter();

        IGenericProjectElement genericProjectElement = createGenericProjectElement(typeToCreate,
                extensionId);
        adapter.setBackingObject(genericProjectElement);

        ((Project) project).getElementsInternal().add(adapter);
        return adapter;
    }
View Full Code Here

        return adapter;
    }

    public ProjectElementAdapter createProjectElementAdapter(IProject project, String elemName,
            Class<? extends IGenericProjectElement> typeToCreate, String extensionId) {
        ProjectElementAdapter adapter = createProjectElementAdapter();
        adapter.setName(elemName);

        IGenericProjectElement genericProjectElement = createGenericProjectElement(typeToCreate,
                extensionId);
        adapter.setBackingObject(genericProjectElement);

        ((Project) project).getElementsInternal().add(adapter);
        return adapter;
    }
View Full Code Here

    public void init( IWorkbenchWindow window ) {
    }
   
    public void run( IAction action ) {
        IProject project = ApplicationGIS.getActiveProject();
        ProjectElementAdapter element = ApplicationGIS.createGeneralProjectElement(project ,
                MyProjectElement.class, MyProjectElement.EXT_ID);
        MyProjectElement myElement = (MyProjectElement) element.getBackingObject();
        if( random.nextBoolean() ){
            StringBuilder builder = new StringBuilder();
            for(int i =0; i<(random.nextInt(5)+2);i++ ){
                builder.append(String.valueOf(random.nextInt(9)));
            }
            myElement.setLabel(builder.toString());
            element.setName(builder.toString());
        }
    }
View Full Code Here

     * If the extension's LabelProvider is non-null and implements the
     * IColorProvider interface the foreground color from the provider is
     * returned otherwise null is returned
     */
    public Color getForeground(Object object) {
        ProjectElementAdapter projectElementAdapter = ((ProjectElementAdapter) object);
        IGenericProjectElement backingObject = projectElementAdapter.getBackingObject();
        if (backingObject == null) {
            return null;
        }
        String extensionId = backingObject.getExtensionId();
        IConfigurationElement extension = findExtension(extensionId);
View Full Code Here

     * If the extension's LabelProvider is non-null and implements the
     * IColorProvider interface the background color from the provider is
     * returned otherwise null is returned
     */
    public Color getBackground(Object object) {
        ProjectElementAdapter projectElementAdapter = ((ProjectElementAdapter) object);
        IGenericProjectElement backingObject = projectElementAdapter.getBackingObject();
        if (backingObject == null) {
            return null;
        }
        String extensionId = backingObject.getExtensionId();
        IConfigurationElement extension = findExtension(extensionId);
View Full Code Here

     * If the extension's LabelProvider is non-null and implements the
     * IFontProvider interface the font from the provider is returned otherwise
     * null is returned
     */
    public Font getFont(Object object) {
        ProjectElementAdapter projectElementAdapter = ((ProjectElementAdapter) object);
        IGenericProjectElement backingObject = projectElementAdapter.getBackingObject();
        if (backingObject == null) {
            return null;
        }
        String extensionId = backingObject.getExtensionId();
        IConfigurationElement extension = findExtension(extensionId);
View Full Code Here

     * ProjectElementAdapter the a default image is returned
     *
     * @generated NOT
     */
    public Object getImage(Object object) {
        ProjectElementAdapter projectElementAdapter = ((ProjectElementAdapter) object);
        IGenericProjectElement backingObject = projectElementAdapter.getBackingObject();
        if (backingObject == null) {
            return null;
        }
        String extensionId = backingObject.getExtensionId();
        IConfigurationElement extension = findExtension(extensionId);
View Full Code Here

     * ProjectElementAdapter the a default text is returned
     *
     * @generated NOT
     */
    public String getText(Object object) {
        ProjectElementAdapter projectElementAdapter = ((ProjectElementAdapter) object);
        IGenericProjectElement backingObject = projectElementAdapter.getBackingObject();
        if (backingObject == null) {
            return projectElementAdapter.getName() + "- No backing object";
        }
        String extensionId = backingObject.getExtensionId();
        IConfigurationElement extension = findExtension(extensionId);
        String labelProviderAtt = extension.getAttribute(LABEL_PROVIDER_ATT);
        String text = null;
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.element.ProjectElementAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.