Search in sources :

Example 6 with IPropertySheetPage

use of org.eclipse.ui.views.properties.IPropertySheetPage in project gemoc-studio by eclipse.

the class GexpressionsEditor 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) {
            GexpressionsEditor.this.setSelectionToViewer(selection);
            GexpressionsEditor.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 7 with IPropertySheetPage

use of org.eclipse.ui.views.properties.IPropertySheetPage in project webtools.sourceediting by eclipse.

the class TestPropertySheetConfiguration method testPropertySourceRemoval.

public void testPropertySourceRemoval() throws BadLocationException {
    IDocument document = (IDocument) fEditor.getAdapter(IDocument.class);
    // set up the editor document
    document.replace(0, 0, "<test><myproperty props=\"yes\" /></test>");
    // set current selection in editor
    ISelection setSelection = new TextSelection(9, 0);
    fEditor.getSelectionProvider().setSelection(setSelection);
    // get current selection in editor
    Object item = null;
    ISelection selection = fEditor.getSelectionProvider().getSelection();
    if (selection instanceof IStructuredSelection) {
        item = ((IStructuredSelection) selection).getFirstElement();
        IPropertySheetPage propertySheet = (IPropertySheetPage) fEditor.getAdapter(IPropertySheetPage.class);
        assertTrue("No ConfigurablePropertySheetPage found", propertySheet instanceof ConfigurablePropertySheetPage);
        if (propertySheet instanceof ConfigurablePropertySheetPage) {
            ConfigurablePropertySheetPage cps = (ConfigurablePropertySheetPage) propertySheet;
            PropertySheetConfiguration config = cps.getConfiguration();
            assertNotNull("No property sheet configuration found", config);
            IPropertySourceProvider provider = config.getPropertySourceProvider(cps);
            assertNotNull("No property sheet provider found", provider);
            IPropertySource source = provider.getPropertySource(item);
            if (source instanceof IPropertySourceExtension) {
                boolean canRemove = ((IPropertySourceExtension) source).isPropertyRemovable("props");
                assertTrue("Current property cannot be removed", canRemove);
                if (canRemove) {
                    ((IPropertySourceExtension) source).removeProperty("props");
                    assertTrue("Current property cannot be removed", true);
                    // failing assert
                    return;
                }
            }
        }
    }
    // if we get to here, always fail, since something went wrong.
    assertTrue("testPropertySourceRemoval test did not take expected path", false);
}
Also used : ConfigurablePropertySheetPage(org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage) IPropertySourceProvider(org.eclipse.ui.views.properties.IPropertySourceProvider) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) TextSelection(org.eclipse.jface.text.TextSelection) ISelection(org.eclipse.jface.viewers.ISelection) IPropertySourceExtension(org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension) IPropertySource(org.eclipse.ui.views.properties.IPropertySource) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PropertySheetConfiguration(org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration) IDocument(org.eclipse.jface.text.IDocument)

Example 8 with IPropertySheetPage

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

the class cloudprofileEditor 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) {
            cloudprofileEditor.this.setSelectionToViewer(selection);
            cloudprofileEditor.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 9 with IPropertySheetPage

use of org.eclipse.ui.views.properties.IPropertySheetPage in project InformationSystem by ObeoNetwork.

the class ApplicationEditor 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) {
            ApplicationEditor.this.setSelectionToViewer(selection);
            ApplicationEditor.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 10 with IPropertySheetPage

use of org.eclipse.ui.views.properties.IPropertySheetPage in project InformationSystem by ObeoNetwork.

the class ToolkitsEditor 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) {
            ToolkitsEditor.this.setSelectionToViewer(selection);
            ToolkitsEditor.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

IPropertySheetPage (org.eclipse.ui.views.properties.IPropertySheetPage)16 ArrayList (java.util.ArrayList)15 List (java.util.List)15 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)15 ExtendedPropertySheetPage (org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage)15 IActionBars (org.eclipse.ui.IActionBars)15 PropertySheetPage (org.eclipse.ui.views.properties.PropertySheetPage)15 IDocument (org.eclipse.jface.text.IDocument)1 TextSelection (org.eclipse.jface.text.TextSelection)1 ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 IPropertySource (org.eclipse.ui.views.properties.IPropertySource)1 IPropertySourceProvider (org.eclipse.ui.views.properties.IPropertySourceProvider)1 ConfigurablePropertySheetPage (org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage)1 IPropertySourceExtension (org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension)1 PropertySheetConfiguration (org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration)1