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();
}
}
}
}
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);
}
};
}
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();
}
}
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;
}
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();
}
Aggregations