use of org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog in project webtools.sourceediting by eclipse.
the class AddXSDRedefinableContentAction method run.
public void run() {
Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
if (selection instanceof XSDBaseAdapter) {
selection = ((XSDBaseAdapter) selection).getTarget();
}
if (selection instanceof XSDRedefine) {
ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
configuration.setDescriptionProvider(new RedefineDescriptor());
configuration.setSearchListProvider(new RedefineSearchListProvider((XSDRedefine) selection, this));
ComponentSearchListDialog dialog = new ComponentSearchListDialog(Display.getDefault().getActiveShell(), Messages._UI_LABEL_REDEFINE_COMPONENT, configuration) {
protected Control createDialogArea(Composite parent) {
// Adjust the dialog's initial size.
Composite mainComposite = (Composite) super.createDialogArea(parent);
GridData gridData = (GridData) mainComposite.getLayoutData();
gridData.heightHint = 500;
gridData.widthHint = 350;
return mainComposite;
}
};
dialog.create();
dialog.setBlockOnOpen(true);
int result = dialog.open();
if (result == Window.OK) {
ComponentSpecification selectedComponent = dialog.getSelectedComponent();
buildRedefine((XSDRedefine) selection, selectedComponent);
}
}
}
Aggregations