Source:
private void createModelExplorerButton(Composite parent, final TreeViewer theTreeViewer) { Composite subComposite = toolkit.createComposite(parent, SWT.NONE); subComposite.setLayout(GridLayoutFactory.fillDefaults().margins(0, 0).create()); subComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); Composite buttonsComposite = toolkit.createComposite(subComposite, SWT.NONE); FillLayout buttonsLayout = new FillLayout(SWT.BEGINNING); buttonsLayout.spacing = 5; buttonsComposite.setLayout(buttonsLayout); addButton(buttonsComposite, "New...", () -> { new NewWizardAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow()).run(); }); addButton(buttonsComposite, Messages.UI_SessionEditor_models_button_newSemanticModel, () -> { AddModelDependencyAction addModelDependencyAction = new AddModelDependencyAction(session); addModelDependencyAction.run(); }); removeSemanticModelOrRepresentationButton = addButton(buttonsComposite, Messages.UI_SessionEditor_models_button_removeSemanticModel, () -> { if (theTreeViewer != null) { final IStructuredSelection selection = (IStructuredSelection) theTreeViewer.getSelection(); Collection<?> selectedObjects = selection.toList(); if (!selectedObjects.isEmpty()) { RemoveSemanticResourceAction removeSemanticResourceAction = new RemoveSemanticResourceAction(getSemanticResources(selectedObjects), session); removeSemanticResourceAction.run(); } theTreeViewer.refresh(); } }); removeSemanticModelOrRepresentationButton.setEnabled(false); deleteActionHandler.setEnabled(false); renameActionHandler.setEnabled(false); }

Target:
private void createModelExplorerButton(Composite parent, final TreeViewer theTreeViewer) { Composite subComposite = toolkit.createComposite(parent, SWT.NONE); subComposite.setLayout(GridLayoutFactory.fillDefaults().margins(0, 0).create()); subComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); Composite buttonsComposite = toolkit.createComposite(subComposite, SWT.NONE); FillLayout buttonsLayout = new FillLayout(SWT.BEGINNING); buttonsLayout.spacing = 5; buttonsComposite.setLayout(buttonsLayout); addButton(buttonsComposite, Messages.UI_SessionEditor_new_semantic_model_action_label, () -> { new NewWizardAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow()).run(); }); addButton(buttonsComposite, Messages.UI_SessionEditor_models_button_newSemanticModel, () -> { AddModelDependencyAction addModelDependencyAction = new AddModelDependencyAction(session); addModelDependencyAction.run(); }); removeSemanticModelOrRepresentationButton = addButton(buttonsComposite, Messages.UI_SessionEditor_models_button_removeSemanticModel, () -> { if (theTreeViewer != null) { final IStructuredSelection selection = (IStructuredSelection) theTreeViewer.getSelection(); Collection<?> selectedObjects = selection.toList(); if (!selectedObjects.isEmpty()) { RemoveSemanticResourceAction removeSemanticResourceAction = new RemoveSemanticResourceAction(getSemanticResources(selectedObjects), session); removeSemanticResourceAction.run(); } theTreeViewer.refresh(); } }); removeSemanticModelOrRepresentationButton.setEnabled(false); deleteActionHandler.setEnabled(false); renameActionHandler.setEnabled(false); }