public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginHeight = 0; layout.marginWidth = 5; container.setLayout(layout); tablePart.createControl(container); pluginListViewer = tablePart.getTableViewer(); pluginListViewer.setContentProvider(new BuildpathContentProvider()); pluginListViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); GridData gd = (GridData) tablePart.getControl().getLayoutData(); gd.heightHint = 300; gd.widthHint = 300; pluginListViewer.setInput(PDEPlugin.getDefault()); if (fSelected != null && fSelected.length > 0) { tablePart.setSelection(fSelected); } setControl(container); Dialog.applyDialogFont(container); PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.UPDATE_CLASSPATH); }
/** * Creates a new BundleExplorerDialog. * * @param shell the parent shell for the dialog * @param multi <code>true</code> if multi selection is allowed */ public BundleExplorerDialog(Shell shell, boolean multi, IPluginModelBase[] models) { super(shell, multi); setTitle("Plug-in Selection"); setMessage("Select a Plug-in:"); fModels = models; PDEPlugin.getDefault().getLabelProvider().connect(this); setListLabelProvider(PDEPlugin.getDefault().getLabelProvider()); }
private void createContentSection( IManagedForm managedForm, Composite parent, FormToolkit toolkit) { String sectionTitle; // if (isFragment()) { // sectionTitle = PDEUIMessages.ManifestEditor_ContentSection_ftitle; // } else { // sectionTitle = PDEUIMessages.ManifestEditor_ContentSection_title; // } sectionTitle = PDEUIMessages.MonitorEditor_ContentSection_title; Section section = createStaticSection(toolkit, parent, sectionTitle); Composite container = createStaticSectionClient(toolkit, section); FormText text = createClient( container, isFragment() ? PDEUIMessages.OverviewPage_fContent : PDEUIMessages.OverviewPage_content, toolkit); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); text.setImage( "page", lp.get(PDEPluginImages.DESC_PAGE_OBJ, SharedLabelProvider.F_EDIT)); // $NON-NLS-1$ if (!isBundle() && isEditable()) { String content; if (isFragment()) { content = PDEUIMessages.OverviewPage_fOsgi; } else { content = PDEUIMessages.OverviewPage_osgi; } text = createClient(container, content, toolkit); } section.setClient(container); }
/** Constructor to create a new wizard */ public NewPluginProjectFromTemplateWizard() { setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWPPRJ_WIZ); setDialogSettings(PDEPlugin.getDefault().getDialogSettings()); setWindowTitle(PDEUIMessages.NewProjectWizard_title); setNeedsProgressMonitor(true); fPluginData = new PluginFieldData(); }
public PluginWorkingSet() { super( "page1", PDEUIMessages.PluginWorkingSet_title, PDEPluginImages.DESC_DEFCON_WIZ); // $NON-NLS-1$ PDEPlugin.getDefault().getLabelProvider().connect(this); }
protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); if (isFragment()) { form.setImage( PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_FRAGMENT_MF_OBJ)); } else { form.setImage( PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_PLUGIN_MF_OBJ)); } form.setText(PDEUIMessages.MonitorEditor_OverviewPage_title); fillBody(managedForm, toolkit); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(form.getBody(), IHelpContextIds.MONITOR_PLUGIN_OVERVIEW); }
private void createTabs() { for (int i = 0; i < TAB_LABELS.length; i++) { CTabItem item = new CTabItem(fTabFolder, SWT.NULL); item.setText(TAB_LABELS[i]); item.setImage( PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_OPERATING_SYSTEM_OBJ)); } fLastTab = 0; fTabFolder.setSelection(fLastTab); }
public NewLibraryPluginCreationUpdateRefPage( LibraryPluginFieldData data, Collection<?> initialJarPaths, Collection<?> selection) { super("UpdateReferences"); // $NON-NLS-1$ setTitle(PDEUIMessages.UpdateBuildpathWizard_title); setDescription(PDEUIMessages.UpdateBuildpathWizard_desc); computeUnmigrated(); computeSelected(selection); fData = data; tablePart = new TablePart(PDEUIMessages.UpdateBuildpathWizard_availablePlugins); PDEPlugin.getDefault().getLabelProvider().connect(this); }
/** The default constructor. */ public SampleWizard() { PDEPlugin.getDefault().getLabelProvider().connect(this); setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWEXP_WIZ); samples = Platform.getExtensionRegistry() .getConfigurationElementsFor("org.eclipse.pde.ui.samples"); // $NON-NLS-1$ namesPage = new ProjectNamesPage(this); lastPage = new ReviewPage(this); setNeedsProgressMonitor(true); setWindowTitle(PDEUIMessages.ShowSampleAction_title); }
protected void createFormContent(final IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); form.setText(PDEUIMessages.OverviewPage_title); PDELabelProvider labelProvider = PDEPlugin.getDefault().getLabelProvider(); ImageDescriptor description = PDEPluginImages.DESC_PRODUCT_DEFINITION; form.setImage(labelProvider.get(description)); fillBody(managedForm, toolkit); IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); String contextId = WARProductConstants.HELP_CONTEXT_OVERVIEW_PAGE; helpSystem.setHelp(form.getBody(), contextId); }
private void handleAdd() { ElementListSelectionDialog dialog = new ElementListSelectionDialog( PDEPlugin.getActiveWorkbenchShell(), PDEPlugin.getDefault().getLabelProvider()); dialog.setElements(getBundles()); dialog.setTitle(PDEUIMessages.PluginSelectionDialog_title); dialog.setMessage(PDEUIMessages.PluginSelectionDialog_message); dialog.setMultipleSelection(true); if (dialog.open() == Window.OK) { Object[] bundles = dialog.getResult(); for (int i = 0; i < bundles.length; i++) { BundleDescription desc = (BundleDescription) bundles[i]; addPlugin(desc.getSymbolicName(), "0.0.0"); // $NON-NLS-1$ // addPlugin(desc.getSymbolicName(), desc.getVersion().toString()); } } }
private void createImpTable(Composite container) { fElementViewer = new TableViewer(container, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 250; fElementViewer.getControl().setLayoutData(gd); fElementViewer.getControl().setFont(container.getFont()); fElementViewer.setContentProvider( new DefaultTableProvider() { public Object[] getElements(Object inputElement) { ITargetDefinition target = getTargetDefinition(); if (target != null) { NameVersionDescriptor[] bundles = target.getImplicitDependencies(); if (bundles != null) { return bundles; } } return new NameVersionDescriptor[0]; } }); fElementViewer.setLabelProvider(new StyledBundleLabelProvider(false, false)); fElementViewer.setInput(PDEPlugin.getDefault()); fElementViewer.setComparator( new ViewerComparator() { public int compare(Viewer viewer, Object e1, Object e2) { NameVersionDescriptor bundle1 = (NameVersionDescriptor) e1; NameVersionDescriptor bundle2 = (NameVersionDescriptor) e2; return super.compare(viewer, bundle1.getId(), bundle2.getId()); } }); fElementViewer.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateImpButtons(); } }); fElementViewer .getTable() .addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.character == SWT.DEL && e.stateMask == 0) { handleRemove(); } } }); }
/* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); GridData sectionData = new GridData(GridData.FILL_BOTH); sectionData.verticalSpan = 2; section.setLayoutData(sectionData); Composite container = createClientContainer(section, 2, toolkit); createViewerPartControl(container, SWT.MULTI, 2, toolkit); container.setLayoutData(new GridData(GridData.FILL_BOTH)); createOptionalDependenciesButton(container); TablePart tablePart = getTablePart(); fPluginTable = tablePart.getTableViewer(); fPluginTable.setContentProvider(new ContentProvider()); fPluginTable.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); fPluginTable.setComparator( new ViewerComparator() { public int compare(Viewer viewer, Object e1, Object e2) { IProductPlugin p1 = (IProductPlugin) e1; IProductPlugin p2 = (IProductPlugin) e2; return super.compare(viewer, p1.getId(), p2.getId()); } }); GridData data = (GridData) tablePart.getControl().getLayoutData(); data.minimumWidth = 200; fPluginTable.setInput(getProduct()); tablePart.setButtonEnabled(0, isEditable()); tablePart.setButtonEnabled(1, isEditable()); tablePart.setButtonEnabled(2, isEditable()); // remove buttons will be updated on refresh tablePart.setButtonEnabled(5, isEditable()); toolkit.paintBordersFor(container); section.setClient(container); section.setText(PDEUIMessages.Product_PluginSection_title); section.setDescription(PDEUIMessages.Product_PluginSection_desc); getModel().addModelChangedListener(this); createSectionToolbar(section, toolkit); }
protected void createFormContent(IManagedForm mform) { super.createFormContent(mform); ScrolledForm form = mform.getForm(); form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 1)); fDescSection = new DescriptionSection(this, form.getBody()); fArchiveSection = new ArchiveSection(this, form.getBody()); fMirrorsSection = new MirrorsSection(this, form.getBody()); mform.addPart(fDescSection); mform.addPart(fMirrorsSection); mform.addPart(fArchiveSection); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(form.getBody(), IHelpContextIds.MANIFEST_SITE_ARCHIVES); form.setText(PDEUIMessages.ArchivePage_title); form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_JAVA_LIB_OBJ)); }
private void createExtensionSection( IManagedForm managedForm, Composite parent, FormToolkit toolkit) { String sectionTitle = PDEUIMessages.ManifestEditor_ExtensionSection_title; Section section = createStaticSection(toolkit, parent, sectionTitle); Composite container = createStaticSectionClient(toolkit, section); FormText text = createClient( container, isFragment() ? PDEUIMessages.OverviewPage_fExtensionContent : PDEUIMessages.OverviewPage_extensionContent, toolkit); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); text.setImage( "page", lp.get(PDEPluginImages.DESC_PAGE_OBJ, SharedLabelProvider.F_EDIT)); // $NON-NLS-1$ section.setClient(container); }
@Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.ExportPackageSection_title); if (isFragment()) section.setDescription(PDEUIMessages.ExportPackageSection_descFragment); else section.setDescription(PDEUIMessages.ExportPackageSection_desc); Composite container = createClientContainer(section, 2, toolkit); createViewerPartControl(container, SWT.MULTI, 2, toolkit); TablePart tablePart = getTablePart(); fPackageViewer = tablePart.getTableViewer(); fPackageViewer.setContentProvider(new ExportPackageContentProvider()); fPackageViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); fPackageViewer.setComparator( new ViewerComparator() { @Override public int compare(Viewer viewer, Object e1, Object e2) { String s1 = e1.toString(); String s2 = e2.toString(); if (s1.indexOf(" ") != -1) // $NON-NLS-1$ s1 = s1.substring(0, s1.indexOf(" ")); // $NON-NLS-1$ if (s2.indexOf(" ") != -1) // $NON-NLS-1$ s2 = s2.substring(0, s2.indexOf(" ")); // $NON-NLS-1$ return super.compare(viewer, s1, s2); } }); toolkit.paintBordersFor(container); section.setClient(container); GridData gd = new GridData(GridData.FILL_BOTH); if (((ManifestEditor) getPage().getEditor()).isEquinox()) { gd.verticalSpan = 2; gd.minimumWidth = 300; } section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); section.setLayoutData(gd); makeActions(); IBundleModel model = getBundleModel(); fPackageViewer.setInput(model); model.addModelChangedListener(this); updateButtons(); }
private void createTestingSection( IManagedForm managedForm, Composite parent, FormToolkit toolkit) { Section section = createStaticSection(toolkit, parent, PDEUIMessages.ManifestEditor_TestingSection_title); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); Composite container = createStaticSectionClient(toolkit, section); String prefixText = (!((MonitorEditor) getEditor()).showExtensionTabs()) ? PDEUIMessages.OverviewPage_OSGiTesting : isFragment() ? PDEUIMessages.OverviewPage_fTesting : PDEUIMessages.OverviewPage_testing; FormText text = createClient(container, getLauncherText(getLauncherHelper().isOSGi(), prefixText), toolkit); text.setImage("run", lp.get(PDEPluginImages.DESC_RUN_EXC)); // $NON-NLS-1$ text.setImage("debug", lp.get(PDEPluginImages.DESC_DEBUG_EXC)); // $NON-NLS-1$ text.setImage("profile", lp.get(PDEPluginImages.DESC_PROFILE_EXC)); // $NON-NLS-1$ section.setClient(container); }
protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = layout.marginHeight = 9; container.setLayout(layout); GridData gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 300; gd.heightHint = 300; container.setLayoutData(gd); fLoopViewer = new TreeViewer(container); fLoopViewer.setContentProvider(new ContentProvider()); fLoopViewer.setLabelProvider(new LoopLabelProvider()); Tree tree = fLoopViewer.getTree(); gd = new GridData(GridData.FILL_BOTH); tree.setLayoutData(gd); fLoopViewer.setInput(PDEPlugin.getDefault()); fLoopViewer.expandAll(); getShell().setText(PDEUIMessages.LoopDialog_title); return container; }
protected void createViewer(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); fExportPart.createControl(composite); GridData gd = (GridData) fExportPart.getControl().getLayoutData(); gd.heightHint = 125; gd.widthHint = 150; gd.horizontalSpan = 2; TableViewer viewer = fExportPart.getTableViewer(); viewer.setContentProvider(new ExportListProvider()); viewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); viewer.setComparator(ListUtil.PLUGIN_COMPARATOR); viewer.addDoubleClickListener( new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { if (event.getSource() instanceof CheckboxTableViewer) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); ((CheckboxTableViewer) event.getSource()) .setChecked( selection.getFirstElement(), !((CheckboxTableViewer) event.getSource()) .getChecked(selection.getFirstElement())); fExportPart.updateCounter( ((CheckboxTableViewer) event.getSource()).getCheckedElements().length); } } }); fExportPart.getTableViewer().setInput(getInput()); }
class WorkingSetLabelProvider extends LabelProvider { PDEPreferencesManager pref = PDEPlugin.getDefault().getPreferenceManager(); public WorkingSetLabelProvider() { PDEPlugin.getDefault().getLabelProvider().connect(this); } /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) */ public String getText(Object element) { if (element instanceof IPluginModelBase) { IPluginBase plugin = ((IPluginModelBase) element).getPluginBase(); String showType = pref.getString(IPreferenceConstants.PROP_SHOW_OBJECTS); if (showType.equals(IPreferenceConstants.VALUE_USE_IDS)) return plugin.getId(); return plugin.getTranslatedName(); } return super.getText(element); } /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); } /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#dispose() */ public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); } }
/* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ public Image getImage(Object element) { if (element instanceof DependencyLoop) return fLoopImage; return PDEPlugin.getDefault().getLabelProvider().getImage(element); }
public WorkingSetLabelProvider() { PDEPlugin.getDefault().getLabelProvider().connect(this); }
/* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) */ public String getText(Object element) { return PDEPlugin.getDefault().getLabelProvider().getText(element); }
public LoopDialog(Shell parentShell, DependencyLoop[] loops) { super(parentShell); fLoops = loops; PDELabelProvider provider = PDEPlugin.getDefault().getLabelProvider(); fLoopImage = provider.get(PDEPluginImages.DESC_LOOP_OBJ); }
public NewSiteProjectWizard() { setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWSITEPRJ_WIZ); setDialogSettings(PDEPlugin.getDefault().getDialogSettings()); setNeedsProgressMonitor(true); setWindowTitle(PDEUIMessages.NewSiteWizard_wtitle); }
/* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); }
public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); }
/** Creates a new template wizard. */ public AbstractNewPluginTemplateWizard() { super(); setDialogSettings(PDEPlugin.getDefault().getDialogSettings()); setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWEXPRJ_WIZ); setNeedsProgressMonitor(true); }
@Override public void createContents(Composite parent) { parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); FormToolkit toolkit = getManagedForm().getToolkit(); Section section = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(PDEUIMessages.ExtensionPointDetails_title); section.setDescription(PDEUIMessages.ExtensionPointDetails_desc); section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); section.setLayoutData( new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); Composite client = toolkit.createComposite(section); client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 3)); client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fIdEntry = new FormEntry(client, toolkit, PDEUIMessages.ExtensionPointDetails_id, null, false); fIdEntry.setFormEntryListener( new FormEntryAdapter(this) { @Override public void textValueChanged(FormEntry entry) { if (fInput != null) { try { fInput.setId(fIdEntry.getValue()); } catch (CoreException e) { PDEPlugin.logException(e); } } } }); fNameEntry = new FormEntry(client, toolkit, PDEUIMessages.ExtensionPointDetails_name, null, false); fNameEntry.setFormEntryListener( new FormEntryAdapter(this) { @Override public void textValueChanged(FormEntry entry) { if (fInput != null) try { fInput.setName(fNameEntry.getValue()); } catch (CoreException e) { PDEPlugin.logException(e); } } }); boolean editable = getPage().getModel().isEditable(); fSchemaEntry = new FormEntry( client, toolkit, PDEUIMessages.ExtensionPointDetails_schema, PDEUIMessages.ExtensionPointDetails_browse, editable); // fSchemaEntry.setFormEntryListener( new FormEntryAdapter(this) { @Override public void textValueChanged(FormEntry entry) { if (fInput != null) { try { fInput.setSchema(fSchemaEntry.getValue()); } catch (CoreException e) { PDEPlugin.logException(e); } updateRichText(); } } @Override public void linkActivated(HyperlinkEvent e) { IProject project = getPage().getPDEEditor().getCommonProject(); if (fSchemaEntry.getValue() == null || fSchemaEntry.getValue().length() == 0) { generateSchema(); return; } IFile file = project.getFile(fSchemaEntry.getValue()); if (file.exists()) openSchemaFile(file); else generateSchema(); } @Override public void browseButtonSelected(FormEntry entry) { final IProject project = getPage().getPDEEditor().getCommonProject(); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( PDEPlugin.getActiveWorkbenchShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); dialog.setTitle( PDEUIMessages.ManifestEditor_ExtensionPointDetails_schemaLocation_title); dialog.setMessage( PDEUIMessages.ManifestEditor_ExtensionPointDetails_schemaLocation_desc); dialog.setDoubleClickSelects(false); dialog.setAllowMultiple(false); dialog.addFilter( new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFile) { String ext = ((IFile) element).getFullPath().getFileExtension(); return "exsd".equals(ext) || "mxsd".equals(ext); // $NON-NLS-1$ //$NON-NLS-2$ } else if (element instanceof IContainer) { // i.e. IProject, IFolder try { IResource[] resources = ((IContainer) element).members(); for (IResource resource : resources) { if (select(viewer, parent, resource)) return true; } } catch (CoreException e) { PDEPlugin.logException(e); } } return false; } }); dialog.setValidator( new ISelectionStatusValidator() { @Override public IStatus validate(Object[] selection) { IPluginModelBase model = (IPluginModelBase) getPage().getPDEEditor().getAggregateModel(); String pluginName = model.getPluginBase().getId(); if (selection == null || selection.length != 1 || !(selection[0] instanceof IFile)) return new Status( IStatus.ERROR, pluginName, IStatus.ERROR, PDEUIMessages.ManifestEditor_ExtensionPointDetails_validate_errorStatus, null); IFile file = (IFile) selection[0]; String ext = file.getFullPath().getFileExtension(); if ("exsd".equals(ext) || "mxsd".equals(ext)) // $NON-NLS-1$ //$NON-NLS-2$ return new Status(IStatus.OK, pluginName, IStatus.OK, "", null); // $NON-NLS-1$ return new Status( IStatus.ERROR, pluginName, IStatus.ERROR, PDEUIMessages.ManifestEditor_ExtensionPointDetails_validate_errorStatus, null); } }); dialog.setDoubleClickSelects(true); dialog.setStatusLineAboveButtons(true); dialog.setInput(project); dialog.setComparator(new ResourceComparator(ResourceComparator.NAME)); String filePath = fSchemaEntry.getValue(); if (filePath != null && filePath.length() != 0 && project.exists(new Path(filePath))) dialog.setInitialSelection(project.getFile(new Path(filePath))); else dialog.setInitialSelection(null); dialog.create(); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(dialog.getShell(), IHelpContextIds.BROWSE_EXTENSION_POINTS_SCHEMAS); if (dialog.open() == Window.OK) { Object[] elements = dialog.getResult(); if (elements.length > 0) { IResource elem = (IResource) elements[0]; fSchemaEntry.setValue(elem.getProjectRelativePath().toString()); } } } }); createSpacer(toolkit, client, 2); Composite container = toolkit.createComposite(parent, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 1)); container.setLayoutData( new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); fRichText = toolkit.createFormText(container, true); fRichText.setImage( "open", PDEPlugin.getDefault() .getLabelProvider() .get( //$NON-NLS-1$ PDEPluginImages.DESC_SCHEMA_OBJ)); fRichText.setImage( "desc", PDEPlugin.getDefault() .getLabelProvider() .get( //$NON-NLS-1$ PDEPluginImages.DESC_DOC_SECTION_OBJ)); fRichText.setImage( "search", PDEPlugin.getDefault() .getLabelProvider() .get( //$NON-NLS-1$ PDEPluginImages.DESC_PSEARCH_OBJ)); fRichText.addHyperlinkListener( new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { IBaseModel model = getPage().getPDEEditor().getAggregateModel(); String pointID = null; IPluginBase base = ((IPluginModelBase) model).getPluginBase(); String pluginID = base.getId(); String schemaVersion = base.getSchemaVersion(); if (schemaVersion != null && Double.parseDouble(schemaVersion) >= 3.2) { if (fInput.getId().indexOf('.') != -1) pointID = fInput.getId(); } if (pointID == null) pointID = pluginID + "." + fInput.getId(); // $NON-NLS-1$ IPluginExtensionPoint extPoint = PDECore.getDefault().getExtensionsRegistry().findExtensionPoint(pointID); if (e.getHref().equals("search")) { // $NON-NLS-1$ new FindReferencesAction(fInput, pluginID).run(); } else if (e.getHref().equals("open")) { // $NON-NLS-1$ if (extPoint == null) { IProject project = getPage().getPDEEditor().getCommonProject(); IFile file = project.getFile(fSchemaEntry.getValue()); if (file.exists()) openSchemaFile(file); else generateSchema(); return; } OpenSchemaAction action = new OpenSchemaAction(); action.setInput(pointID); action.setEnabled(true); action.run(); } else { if (extPoint == null) { IProject project = getPage().getPDEEditor().getCommonProject(); IFile file = project.getFile(fSchemaEntry.getValue()); URL url; try { url = file.getLocationURI().toURL(); } catch (MalformedURLException e1) { return; } SchemaDescriptor schemaDesc = new SchemaDescriptor(pointID, url); Schema schema = new Schema(schemaDesc, url, false); schema.setPluginId(pluginID); schema.setPointId(fInput.getId()); schema.setName(fNameEntry.getValue()); new ShowDescriptionAction(schema).run(); return; } new ShowDescriptionAction(pointID).run(); } } }); fIdEntry.setEditable(isEditable()); fNameEntry.setEditable(isEditable()); fSchemaEntry.setEditable(isEditable()); toolkit.paintBordersFor(client); section.setClient(client); IPluginModelBase model = (IPluginModelBase) getPage().getModel(); model.addModelChangedListener(this); markDetailsPart(section); }