Search in sources :

Example 36 with PropertySheetPage

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

the class CSSNodeAdapter method internalRefreshAll.

/**
 */
public void internalRefreshAll() {
    Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
    Iterator iterator = listeners.iterator();
    while (iterator.hasNext()) {
        Object listener = iterator.next();
        if (listener instanceof StructuredViewer) {
            StructuredViewer viewer = (StructuredViewer) listener;
            if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewer.refresh();
            }
        } else if (listener instanceof PropertySheetPage) {
            PropertySheetPage page = (PropertySheetPage) listener;
            if (page.getControl() != null && !page.getControl().isDisposed()) {
                page.refresh();
            }
        }
    }
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) Iterator(java.util.Iterator) Collection(java.util.Collection) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer)

Example 37 with PropertySheetPage

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

the class OpenShiftResourcePropertySection method createContents.

protected void createContents(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    this.page = aTabbedPropertySheetPage;
    parent.setLayout(new GridLayout());
    SashForm container = new SashForm(parent, SWT.VERTICAL);
    GridData d = new GridData(GridData.FILL_BOTH);
    // A dirty trick that keeps table from growing
    d.widthHint = 100;
    // unlimitedly within scrolled parent composite.
    d.heightHint = 100;
    container.setLayoutData(d);
    Composite tableContainer = new Composite(container, SWT.NONE);
    tableContainer.setLayout(new FillLayout());
    this.table = createTable(tableContainer);
    details = new PropertySheetPage();
    details.createControl(container);
    selectionProvider = new ISelectionProvider() {

        @Override
        public void setSelection(ISelection selection) {
        }

        @Override
        public void removeSelectionChangedListener(ISelectionChangedListener listener) {
            table.removeSelectionChangedListener(listener);
        }

        @Override
        public ISelection getSelection() {
            return table.getSelection();
        }

        @Override
        public void addSelectionChangedListener(ISelectionChangedListener listener) {
            table.addSelectionChangedListener(listener);
        }
    };
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Composite(org.eclipse.swt.widgets.Composite) ISelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) ISelection(org.eclipse.jface.viewers.ISelection) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 38 with PropertySheetPage

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

the class OpenShiftUIUtils method refreshPropertySheetPage.

/**
 * Refreshes the current page sheet of Property Sheet view.
 * @param sh
 */
public static void refreshPropertySheetPage(PropertySheet propertySheet) {
    if (propertySheet == null)
        return;
    IPage page = propertySheet.getCurrentPage();
    if (page instanceof TabbedPropertySheetPage) {
        TabbedPropertySheetPage p = (TabbedPropertySheetPage) page;
        if (p == null || p.getControl() == null || p.getControl().isDisposed())
            return;
        p.refresh();
    } else if (page instanceof PropertySheetPage) {
        PropertySheetPage p = (PropertySheetPage) page;
        if (p == null || p.getControl() == null || p.getControl().isDisposed())
            return;
        p.refresh();
    }
}
Also used : IPage(org.eclipse.ui.part.IPage) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)

Example 39 with PropertySheetPage

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

the class ExporterSettingsTab method createPropertySheet.

private Control createPropertySheet(Composite exportersComposite) {
    propertySheet = new PropertySheetPage() {

        public void handleEntrySelection(ISelection selection) {
            super.handleEntrySelection(selection);
            IStructuredSelection iss = (IStructuredSelection) selection;
            IPropertyDescriptor propertyDescriptor = null;
            if (!iss.isEmpty()) {
                MyPropertySheetEntry mse = (MyPropertySheetEntry) iss.getFirstElement();
                propertyDescriptor = mse.getMyDescriptor();
            }
            updateCurrentDescriptor(propertyDescriptor);
        }
    };
    propertySheet.createControl(exportersComposite);
    final PropertySheetEntry propertySheetEntry = new MyPropertySheetEntry();
    propertySheetEntry.setPropertySourceProvider(new IPropertySourceProvider() {

        public IPropertySource getPropertySource(Object object) {
            if (object instanceof ExporterFactory) {
                return new ExporterFactoryPropertySource((ExporterFactory) object) {

                    public void setPropertyValue(Object id, Object value) {
                        super.setPropertyValue(id, value);
                        dialogChanged();
                    }
                };
            } else {
                return null;
            }
        }
    });
    propertySheet.setRootEntry(propertySheetEntry);
    // propertySheetEntry.setValues( new Object[] { this });
    getExporterTable().addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection s = (IStructuredSelection) event.getSelection();
            if (s.isEmpty()) {
                if (add != null)
                    add.setEnabled(false);
                if (remove != null)
                    remove.setEnabled(false);
                if (edit != null)
                    edit.setEnabled(false);
                propertySheetEntry.setValues(new Object[0]);
            } else {
                if (add != null)
                    add.setEnabled(true);
                boolean hasSelection = false;
                if (currentDescriptor != null) {
                    hasSelection = true;
                }
                if (remove != null)
                    remove.setEnabled(hasSelection);
                if (edit != null)
                    edit.setEnabled(hasSelection);
                ExporterFactory ep = (ExporterFactory) s.getFirstElement();
                propertySheetEntry.setValues(new Object[] { ep });
            // if(ep.isEnabled( configuration ))
            }
        }
    });
    Control control = propertySheet.getControl();
    if (control instanceof Tree && !control.isDisposed()) {
        Tree tree = (Tree) control;
        tree.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(SelectionEvent e) {
            }

            public void widgetSelected(SelectionEvent e) {
                IPropertyDescriptor propertyDescriptor = null;
                if (e.item != null && e.item.getData() != null) {
                    MyPropertySheetEntry mse = (MyPropertySheetEntry) e.item.getData();
                    propertyDescriptor = mse.getMyDescriptor();
                }
                updateCurrentDescriptor(propertyDescriptor);
            }
        });
    }
    return control;
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySourceProvider(org.eclipse.ui.views.properties.IPropertySourceProvider) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) IPropertySource(org.eclipse.ui.views.properties.IPropertySource) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PropertySheetEntry(org.eclipse.ui.views.properties.PropertySheetEntry) Control(org.eclipse.swt.widgets.Control) ExporterFactory(org.hibernate.eclipse.console.model.impl.ExporterFactory) ISelection(org.eclipse.jface.viewers.ISelection) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Tree(org.eclipse.swt.widgets.Tree) IPropertyDescriptor(org.eclipse.ui.views.properties.IPropertyDescriptor) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 40 with PropertySheetPage

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

the class systemadaptationEditor method dispose.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void dispose() {
    updateProblemIndication = false;
    ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
    getSite().getPage().removePartListener(partListener);
    adapterFactory.dispose();
    if (getActionBarContributor().getActiveEditor() == this) {
        getActionBarContributor().setActiveEditor(null);
    }
    for (PropertySheetPage propertySheetPage : propertySheetPages) {
        propertySheetPage.dispose();
    }
    if (contentOutlinePage != null) {
        contentOutlinePage.dispose();
    }
    super.dispose();
}
Also used : PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage)

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