/** * Creates the prototype attributes tree component * * @param parent the parent composite to add this one to */ private void createPrototypeAttributesTreeComponent(Composite parent) { Composite attributesPrototypeTableComposite = new Composite(parent, SWT.NONE); attributesPrototypeTableComposite.setLayout(new GridLayout(1, false)); attributesPrototypeTableComposite.setFont(parent.getFont()); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); attributesPrototypeTableComposite.setLayoutData(gd); fAttributesTreeViewer = createCheckboxTreeViewer(attributesPrototypeTableComposite); }
@Override public void createControl(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH); setControl(comp); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId()); createConfigPrototypeComponent(comp); createPrototypeExplanationsComponent(comp); createPrototypeAttributesTreeComponent(comp); }
@Override public String getText(Object element) { String key = ((Entry<String, Object>) element).getKey(); ILaunchConfigurationTab[] tabs = getLaunchConfigurationDialog().getTabs(); for (ILaunchConfigurationTab tab : tabs) { if (tab instanceof AbstractLaunchConfigurationTab) { String attributeLabel = ((AbstractLaunchConfigurationTab) tab).getAttributeLabel(key); if (attributeLabel != null) { return attributeLabel; } } } return key; } }
String currentSelectedPrototypeString = fPrototypeText.getText(); DecoratingLabelProvider labelProvider = new DecoratingLabelProvider(DebugUITools.newDebugModelPresentation(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()); ElementListSelectionDialog selectPrototypeDialog = new ElementListSelectionDialog(getShell(), labelProvider); try { ILaunchConfigurationType type = fSelectedLaunchConfiguration.getType(); selectPrototypeDialog.setTitle(LaunchConfigurationsMessages.PrototypeTab_Select_Message_5); selectPrototypeDialog.setEmptySelectionMessage(LaunchConfigurationsMessages.PrototypeTab_Select_Empty_Message_6); selectPrototypeDialog.setInitialSelections(getPrototype(prototypes, currentSelectedPrototypeString)); int open = selectPrototypeDialog.open(); if (open == Window.OK) { if (selectedPrototype instanceof ILaunchConfiguration) { fAppliedPrototype = (ILaunchConfiguration) selectedPrototype; ILaunchConfigurationWorkingCopy workingCopy = getWorkingCopy(); workingCopy.setPrototype(fAppliedPrototype, true); fPrototypeText.setText(((ILaunchConfiguration) selectedPrototype).getName()); fUnlinkPrototypeButton.setEnabled(true); fResetPrototypeButton.setEnabled(true); updateColumnsWidth(); updateProductDecorator(); setDirty(true); updateLaunchConfigurationDialog(); reinitTabs(workingCopy);
fAppliedPrototype = configuration; fSelectedLaunchConfiguration = configuration; addColumnsToTreeViewer(fAttributesTreeViewer); fAttributesTreeViewer.setInput(fAppliedPrototype); fAttributesTreeViewer.getTree().setEnabled(true); fSelectedLaunchConfiguration = configuration; fAppliedPrototype = configuration.getPrototype(); addColumnsToTreeViewer(fAttributesTreeViewer); fAttributesTreeViewer.getTree().setEnabled(false); if (fAppliedPrototype == null) { updateProductDecorator(); updateColumnsWidth(); } catch (CoreException e) { DebugUIPlugin.log(e.getStatus());
@Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = null; tabs = new ILaunchConfigurationTab[] {new MainTab(), new JavaArgumentsTab(), new PluginsTab(), new ConfigurationTab(), new TracingTab(), new EnvironmentTab(), new CommonTab(), new PrototypeTab()}; setTabs(tabs); }
/** * Reinit the tabs of the launch configuration dialog. * * @param launchConfiguration the {@link LaunchConfiguration}. */ private void reinitTabs(ILaunchConfiguration launchConfiguration) { ILaunchConfigurationTab[] tabs = getLaunchConfigurationDialog().getTabs(); for (ILaunchConfigurationTab configTab : tabs) { configTab.initializeFrom(launchConfiguration); } }
@Override public void postApply() { super.postApply(); ILaunchConfigurationDialog launchConfigurationDialog = getLaunchConfigurationDialog(); if (launchConfigurationDialog instanceof LaunchConfigurationsDialog) { ((LaunchConfigurationsDialog) launchConfigurationDialog).refreshLaunchConfigurationView(); } }