Search in sources :

Example 6 with PropertySheetPage

use of org.eclipse.ui.views.properties.PropertySheetPage in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method getAdapter.

@Override
public <T> T getAdapter(Class<T> adapter) {
    if (adapter.equals(IPropertySheetPage.class)) {
        PropertySheetPage page = new PropertySheetPage();
        page.setPropertySourceProvider(new ConsoleConfigurationPropertySourceProvider());
        return adapter.cast(page);
    }
    return super.getAdapter(adapter);
}
Also used : IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage)

Example 7 with PropertySheetPage

use of org.eclipse.ui.views.properties.PropertySheetPage in project iobserve-analysis by research-iobserve.

the class systemadaptationEditor method getPropertySheetPage.

/**
 * This accesses a cached version of the property sheet.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IPropertySheetPage getPropertySheetPage() {
    PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain) {

        @Override
        public void setSelectionToViewer(List<?> selection) {
            systemadaptationEditor.this.setSelectionToViewer(selection);
            systemadaptationEditor.this.setFocus();
        }

        @Override
        public void setActionBars(IActionBars actionBars) {
            super.setActionBars(actionBars);
            getActionBarContributor().shareGlobalActions(this, actionBars);
        }
    };
    propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
    propertySheetPages.add(propertySheetPage);
    return propertySheetPage;
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider) ArrayList(java.util.ArrayList) List(java.util.List) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) IActionBars(org.eclipse.ui.IActionBars)

Example 8 with PropertySheetPage

use of org.eclipse.ui.views.properties.PropertySheetPage in project iobserve-analysis by research-iobserve.

the class systemadaptationEditor method initializeEditingDomain.

/**
 * This sets up the editing domain for the model editor.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void initializeEditingDomain() {
    // Create an adapter factory that yields item providers.
    // 
    adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new systemadaptationItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new IdentifierItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new PcmItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new CoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EntityItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new CompositionItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new UsagemodelItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new RepositoryItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ResourcetypeItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ProtocolItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ParameterItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReliabilityItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SeffItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SeffPerformanceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SeffReliabilityItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new QosannotationsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new QosPerformanceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new QosReliabilityItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SystemItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ResourceenvironmentItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new AllocationItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SubsystemItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ProbfunctionItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new StoexItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new UnitsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    // Create the command stack that will notify this editor as commands are executed.
    // 
    BasicCommandStack commandStack = new BasicCommandStack();
    // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
    // 
    commandStack.addCommandStackListener(new CommandStackListener() {

        public void commandStackChanged(final EventObject event) {
            getContainer().getDisplay().asyncExec(new Runnable() {

                public void run() {
                    firePropertyChange(IEditorPart.PROP_DIRTY);
                    // Try to select the affected objects.
                    // 
                    Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
                    if (mostRecentCommand != null) {
                        setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                    }
                    for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
                        PropertySheetPage propertySheetPage = i.next();
                        if (propertySheetPage.getControl().isDisposed()) {
                            i.remove();
                        } else {
                            propertySheetPage.refresh();
                        }
                    }
                }
            });
        }
    });
    // Create the editing domain with a special command stack.
    // 
    editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
Also used : ResourcetypeItemProviderAdapterFactory(org.palladiosimulator.pcm.resourcetype.provider.ResourcetypeItemProviderAdapterFactory) AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) org.iobserve.planning.systemadaptation.provider.systemadaptationItemProviderAdapterFactory(org.iobserve.planning.systemadaptation.provider.systemadaptationItemProviderAdapterFactory) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) CoreItemProviderAdapterFactory(org.palladiosimulator.pcm.core.provider.CoreItemProviderAdapterFactory) SeffReliabilityItemProviderAdapterFactory(org.palladiosimulator.pcm.seff.seff_reliability.provider.SeffReliabilityItemProviderAdapterFactory) SeffReliabilityItemProviderAdapterFactory(org.palladiosimulator.pcm.seff.seff_reliability.provider.SeffReliabilityItemProviderAdapterFactory) QosReliabilityItemProviderAdapterFactory(org.palladiosimulator.pcm.qosannotations.qos_reliability.provider.QosReliabilityItemProviderAdapterFactory) ReliabilityItemProviderAdapterFactory(org.palladiosimulator.pcm.reliability.provider.ReliabilityItemProviderAdapterFactory) CompositionItemProviderAdapterFactory(org.palladiosimulator.pcm.core.composition.provider.CompositionItemProviderAdapterFactory) QosReliabilityItemProviderAdapterFactory(org.palladiosimulator.pcm.qosannotations.qos_reliability.provider.QosReliabilityItemProviderAdapterFactory) SeffItemProviderAdapterFactory(org.palladiosimulator.pcm.seff.provider.SeffItemProviderAdapterFactory) PcmItemProviderAdapterFactory(org.palladiosimulator.pcm.provider.PcmItemProviderAdapterFactory) RepositoryItemProviderAdapterFactory(org.palladiosimulator.pcm.repository.provider.RepositoryItemProviderAdapterFactory) BasicCommandStack(org.eclipse.emf.common.command.BasicCommandStack) CommandStack(org.eclipse.emf.common.command.CommandStack) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) CommandStackListener(org.eclipse.emf.common.command.CommandStackListener) ResourceItemProviderAdapterFactory(org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory) ProtocolItemProviderAdapterFactory(org.palladiosimulator.pcm.protocol.provider.ProtocolItemProviderAdapterFactory) QosPerformanceItemProviderAdapterFactory(org.palladiosimulator.pcm.qosannotations.qos_performance.provider.QosPerformanceItemProviderAdapterFactory) AllocationItemProviderAdapterFactory(org.palladiosimulator.pcm.allocation.provider.AllocationItemProviderAdapterFactory) SubsystemItemProviderAdapterFactory(org.palladiosimulator.pcm.subsystem.provider.SubsystemItemProviderAdapterFactory) StoexItemProviderAdapterFactory(de.uka.ipd.sdq.stoex.provider.StoexItemProviderAdapterFactory) EntityItemProviderAdapterFactory(org.palladiosimulator.pcm.core.entity.provider.EntityItemProviderAdapterFactory) ComposedAdapterFactory(org.eclipse.emf.edit.provider.ComposedAdapterFactory) BasicCommandStack(org.eclipse.emf.common.command.BasicCommandStack) UsagemodelItemProviderAdapterFactory(org.palladiosimulator.pcm.usagemodel.provider.UsagemodelItemProviderAdapterFactory) ResourceenvironmentItemProviderAdapterFactory(org.palladiosimulator.pcm.resourceenvironment.provider.ResourceenvironmentItemProviderAdapterFactory) EventObject(java.util.EventObject) SystemItemProviderAdapterFactory(org.palladiosimulator.pcm.system.provider.SystemItemProviderAdapterFactory) IdentifierItemProviderAdapterFactory(de.uka.ipd.sdq.identifier.provider.IdentifierItemProviderAdapterFactory) ReflectiveItemProviderAdapterFactory(org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory) ProbfunctionItemProviderAdapterFactory(de.uka.ipd.sdq.probfunction.provider.ProbfunctionItemProviderAdapterFactory) Command(org.eclipse.emf.common.command.Command) UnitsItemProviderAdapterFactory(de.uka.ipd.sdq.units.provider.UnitsItemProviderAdapterFactory) QosannotationsItemProviderAdapterFactory(org.palladiosimulator.pcm.qosannotations.provider.QosannotationsItemProviderAdapterFactory) SeffPerformanceItemProviderAdapterFactory(org.palladiosimulator.pcm.seff.seff_performance.provider.SeffPerformanceItemProviderAdapterFactory) ParameterItemProviderAdapterFactory(org.palladiosimulator.pcm.parameter.provider.ParameterItemProviderAdapterFactory)

Example 9 with PropertySheetPage

use of org.eclipse.ui.views.properties.PropertySheetPage in project egit by eclipse.

the class RepositoriesView method getAdapter.

@Override
public Object getAdapter(Class adapter) {
    // integrate with Properties view
    if (adapter == IPropertySheetPage.class) {
        PropertySheetPage page = new PropertySheetPage();
        page.setPropertySourceProvider(new RepositoryPropertySourceProvider(page));
        return page;
    }
    return super.getAdapter(adapter);
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage)

Example 10 with PropertySheetPage

use of org.eclipse.ui.views.properties.PropertySheetPage in project metalib by softlang.

the class FsmlEditor method getPropertySheetPage.

/**
 * This accesses a cached version of the property sheet.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IPropertySheetPage getPropertySheetPage() {
    PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain) {

        @Override
        public void setSelectionToViewer(List<?> selection) {
            FsmlEditor.this.setSelectionToViewer(selection);
            FsmlEditor.this.setFocus();
        }

        @Override
        public void setActionBars(IActionBars actionBars) {
            super.setActionBars(actionBars);
            getActionBarContributor().shareGlobalActions(this, actionBars);
        }
    };
    propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
    propertySheetPages.add(propertySheetPage);
    return propertySheetPage;
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider) ArrayList(java.util.ArrayList) List(java.util.List) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

PropertySheetPage (org.eclipse.ui.views.properties.PropertySheetPage)63 IPropertySheetPage (org.eclipse.ui.views.properties.IPropertySheetPage)59 ExtendedPropertySheetPage (org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage)51 ArrayList (java.util.ArrayList)15 EventObject (java.util.EventObject)15 HashMap (java.util.HashMap)15 LinkedHashMap (java.util.LinkedHashMap)15 List (java.util.List)15 BasicCommandStack (org.eclipse.emf.common.command.BasicCommandStack)15 Command (org.eclipse.emf.common.command.Command)15 CommandStack (org.eclipse.emf.common.command.CommandStack)15 CommandStackListener (org.eclipse.emf.common.command.CommandStackListener)15 AdapterFactoryEditingDomain (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain)15 ComposedAdapterFactory (org.eclipse.emf.edit.provider.ComposedAdapterFactory)15 ReflectiveItemProviderAdapterFactory (org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory)15 ResourceItemProviderAdapterFactory (org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory)15 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)15 IActionBars (org.eclipse.ui.IActionBars)15 TabbedPropertySheetPage (org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)8 TechnicalIDItemProviderAdapterFactory (org.obeonetwork.dsl.technicalid.provider.TechnicalIDItemProviderAdapterFactory)8