use of org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogEntryDetailsView in project webtools.sourceediting by eclipse.
the class SelectFromCatalogDialog method createCatalogDetailsView.
protected void createCatalogDetailsView(Composite parent) {
Group detailsGroup = new Group(parent, SWT.NONE);
detailsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
detailsGroup.setLayout(new GridLayout());
detailsGroup.setText(XMLCatalogMessages.UI_LABEL_DETAILS);
final XMLCatalogEntryDetailsView detailsView = new XMLCatalogEntryDetailsView(detailsGroup);
ISelectionChangedListener listener = new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
if (selectedObject instanceof ICatalogEntry) {
ICatalogEntry entry = (ICatalogEntry) selectedObject;
detailsView.setCatalogElement(entry);
currentSelectionLocation = entry.getURI();
currentSelectionNamespace = entry.getKey();
} else {
detailsView.setCatalogElement((ICatalogEntry) null);
currentSelectionLocation = "";
currentSelectionNamespace = "";
}
}
};
catalogEntriesView.getViewer().addSelectionChangedListener(listener);
}
Aggregations