Commit 31289d65 authored by Romain Bioteau's avatar Romain Bioteau

Merge remote-tracking branch 'origin/release-7.8.0'

Conflicts:
	subscription/pom.xml
parents ed8ba60a 6fc64d88
......@@ -1270,10 +1270,7 @@
pattern="org.eclipse.ui.navigator.resources.filters.closedProject">
</contentExtension>
</excludes>
</viewerContentBinding>
</extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
......@@ -1310,6 +1307,46 @@
class="org.bonitasoft.studio.application.views.ProjectExplorerViewerComparator"
id="org.eclipse.ui.navigator.resources.sorters.defaultSorter">
</commonSorter>
<actionProvider
class="org.eclipse.jdt.internal.ui.navigator.JavaNavigatorRefactorActionProvider"
id="org.bonitasoft.studio.navigator.actions.RefactorActions"
overrides="org.eclipse.ui.navigator.resources.actions.RefactorActions">
<enablement>
<and>
<or>
<and>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.eclipse.core.resources.projectNature"
value="org.eclipse.jdt.core.javanature">
</test>
</and>
<instanceof
value="org.eclipse.jdt.core.IJavaElement">
</instanceof>
<instanceof
value="org.eclipse.jdt.core.IJarEntryResource">
</instanceof>
<instanceof
value="org.eclipse.jdt.internal.ui.packageview.PackageFragmentRootContainer">
</instanceof>
<adapt
type="java.util.Collection">
<count
value="0">
</count>
</adapt>
</or>
<not>
<instanceof
value="org.eclipse.jdt.core.IPackageFragmentRoot">
</instanceof>
</not>
</and>
</enablement>
</actionProvider>
</navigatorContent>
<commonFilter
activeByDefault="true"
......
......@@ -7,6 +7,7 @@ import static org.mockito.Mockito.when;
import org.bonitasoft.studio.common.repository.Repository;
import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
import org.bonitasoft.studio.common.repository.model.IRepositoryStore;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
......@@ -61,7 +62,7 @@ public class DeleteHandlerTest {
@Test
public void should_be_disable_if_selection_is_a_repository_store() {
IResource resource = mock(IResource.class);
IFolder resource = mock(IFolder.class);
IAdaptable selectionContent = mock(IAdaptable.class);
when(selectionContent.getAdapter(IResource.class)).thenReturn(resource);
IStructuredSelection selection = new StructuredSelection(selectionContent);
......
......@@ -28,6 +28,7 @@ import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
......@@ -50,7 +51,7 @@ public class DeleteHandler extends AbstractHandler {
Repository currentRepository = RepositoryManager.getInstance().getCurrentRepository();
if ((selectedResources.size() == 1 && FileActionDialog
.confirmDeletionQuestion(selectedResources.get(0).getName()))
|| FileActionDialog.confirmDeletionQuestionWithCustomMessage(
|| selectedResources.size() > 1 && FileActionDialog.confirmDeletionQuestionWithCustomMessage(
NLS.bind(IDEWorkbenchMessages.DeleteResourceAction_confirmN,
selectedResources.size()))) {
for (IResource res : selectedResources) {
......@@ -92,7 +93,8 @@ public class DeleteHandler extends AbstractHandler {
IRepositoryFileStore fileStore = currentRepository.getFileStore(adapter);
if (fileStore != null && !fileStore.canBeDeleted()) {
return false;
} else if (fileStore == null && currentRepository.getRepositoryStore(adapter) != null) {
} else if (fileStore == null && currentRepository.getRepositoryStore(adapter) != null
&& adapter instanceof IFolder) {
return false;
}
}
......
......@@ -213,11 +213,13 @@ public class BonitaProjectExplorer extends CommonNavigator {
@Override
protected void internalRefresh(Object element, boolean updateLabels) {
try {
fPendingRefreshes.add(element);
super.internalRefresh(element, updateLabels);
} finally {
fPendingRefreshes.remove(element);
if (!getTree().isDisposed()) {
try {
fPendingRefreshes.add(element);
super.internalRefresh(element, updateLabels);
} finally {
fPendingRefreshes.remove(element);
}
}
}
......
......@@ -18,6 +18,7 @@ import org.bonitasoft.studio.common.perspectives.BonitaPerspectivesUtils;
import org.bonitasoft.studio.common.views.BonitaPropertiesBrowserPage;
import org.bonitasoft.studio.model.process.diagram.part.ProcessDiagramEditor;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.ui.ISaveablePart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
......@@ -35,10 +36,16 @@ import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributo
*/
public abstract class BonitaPropertiesView extends PropertySheet implements IContributedContentsView {
/*
* (non-Javadoc)
* Method declared on PageBookView.
*/
@Override
protected ISaveablePart getSaveablePart() {
return null;
}
@Override
public boolean isDirtyStateSupported() {
return false;
}
@Override
protected PageBookView.PageRec doCreatePage(IWorkbenchPart part) {
// Get a custom property sheet page but not if the part is also a
......@@ -75,10 +82,7 @@ public abstract class BonitaPropertiesView extends PropertySheet implements ICon
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.views.properties.PropertySheet#isImportant(org.eclipse.ui.IWorkbenchPart)
*/
@Override
protected boolean isImportant(IWorkbenchPart part) {
// Don't interfere with other property views
......
......@@ -48,6 +48,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MPopupMenu;
import org.eclipse.e4.ui.model.application.ui.menu.impl.MenuFactoryImpl;
import org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer;
import org.eclipse.e4.ui.workbench.swt.factories.IRendererFactory;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuListener2;
import org.eclipse.jface.action.IMenuManager;
......@@ -59,6 +60,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
......@@ -356,13 +358,16 @@ public class CustomPopupMenuExtender implements IMenuListener2,
StructuredSelection repositoryProject = new StructuredSelection(project);
ISelection selection = selProvider.getSelection();
if (repositoryProject.equals(selection)) {
INCLUDES.remove("compareWithMenu");
INCLUDES.remove("replaceWithMenu");
if (isLocalProject(project)) {
INCLUDES.remove("compareWithMenu");
INCLUDES.remove("replaceWithMenu");
}
INCLUDES.remove("org.eclipse.jdt.ui.source.menu");
INCLUDES.remove("org.eclipse.jdt.ui.refactoring.menu");
INCLUDES.add("org.eclipse.ui.edit.delete");
} else if (((StructuredSelection) selection).getFirstElement() instanceof IProject) {
INCLUDES.add("org.eclipse.ui.edit.delete");
INCLUDES.remove("org.eclipse.jdt.ui.refactoring.menu");
}
Object resource = ((StructuredSelection) selection).getFirstElement();
if (resource instanceof IAdaptable && ((IAdaptable) resource).getAdapter(IResource.class) != null) {
......@@ -370,10 +375,14 @@ public class CustomPopupMenuExtender implements IMenuListener2,
IProject parentProject = adapter.getProject();
StructuredSelection structuredSelection = new StructuredSelection(parentProject);
if (structuredSelection.equals(repositoryProject)) {
INCLUDES.remove("compareWithMenu");
INCLUDES.remove("replaceWithMenu");
INCLUDES.remove("org.eclipse.jdt.ui.source.menu");
INCLUDES.remove("org.eclipse.jdt.ui.refactoring.menu");
if (isLocalProject(project)) {
INCLUDES.remove("compareWithMenu");
INCLUDES.remove("replaceWithMenu");
}
if (!(resource instanceof IJavaElement)) {
INCLUDES.remove("org.eclipse.jdt.ui.source.menu");
INCLUDES.remove("org.eclipse.jdt.ui.refactoring.menu");
}
INCLUDES.add("org.eclipse.ui.edit.delete");
}
}
......@@ -418,6 +427,10 @@ public class CustomPopupMenuExtender implements IMenuListener2,
addStaticActions(mgr);
}
private boolean isLocalProject(IProject project) {
return !RepositoryProvider.isShared(project);
}
/**
* well, this goes to the renderer.
*
......
......@@ -10,14 +10,15 @@ import org.bonitasoft.studio.common.repository.model.IRepositoryStore;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.jdt.ui.JavaElementSorter;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.ui.internal.navigator.resources.workbench.ResourceExtensionSorter;
import org.eclipse.jface.viewers.ViewerSorter;
public class ProjectExplorerViewerComparator extends ViewerComparator {
private ResourceExtensionSorter defaultSorter = new ResourceExtensionSorter();
private ViewerSorter defaultSorter = new JavaElementSorter();
private static Map<String, Integer> ORDER = new HashMap<>();
static {
ORDER.put("organizations", 1);
......
......@@ -38,4 +38,5 @@ public class BonitaGeneralProcessPropertiesView extends BonitaPropertiesView {
ITabbedPropertySheetPageContributor part) {
return new BonitaGeneralProcessPropertiesBrowserPage(part);
}
}
......@@ -26,5 +26,13 @@ public class BonitaExplorerContentProvider extends JavaNavigatorContentProvider
return super.hasChildren(element);
}
@Override
public Object[] getChildren(Object parentElement) {
if (UIDArtifactFilters.isUIDArtifact(parentElement)) {
return new Object[0];
}
return super.getChildren(parentElement);
}
}
......@@ -15,15 +15,13 @@
package org.bonitasoft.studio.application.views.provider;
import java.io.IOException;
import java.util.Objects;
import java.util.Optional;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
import org.bonitasoft.studio.common.repository.model.IRepositoryStore;
import org.bonitasoft.studio.designer.core.repository.WebFragmentRepositoryStore;
import org.bonitasoft.studio.designer.core.repository.WebPageRepositoryStore;
import org.bonitasoft.studio.designer.core.repository.WebWidgetRepositoryStore;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
......@@ -74,20 +72,14 @@ public class BonitaExplorerLabelProvider extends JavaNavigatorLabelProvider {
if (!repositoryManager.hasActiveRepository() || !repositoryManager.getCurrentRepository().isLoaded()) {
return super.getImage(element);
}
if (UIDArtifactFilters.isUIDArtifactFrom(element, "web_page")) {
return repositoryManager.getRepositoryStore(WebPageRepositoryStore.class).getIcon();
}
if (UIDArtifactFilters.isUIDArtifactFrom(element, "web_widgets")) {
return repositoryManager.getRepositoryStore(WebWidgetRepositoryStore.class).getIcon();
}
if (UIDArtifactFilters.isUIDArtifactFrom(element, "web_fragments")) {
return repositoryManager.getRepositoryStore(WebFragmentRepositoryStore.class).getIcon();
}
if (!(element instanceof IJavaElement)) {
if (element instanceof IResource) {
IRepositoryFileStore fileStore = repositoryManager.getCurrentRepository().getFileStore((IResource) element);
if (fileStore != null) {
return packageExplorerProblemsDecorator.decorateImage(fileStore.getIcon(), element);
if (fileStore.getIcon() != null) {
return packageExplorerProblemsDecorator.decorateImage(fileStore.getIcon(), element);
}
return super.getImage(element);
}
}
Optional<IRepositoryStore<? extends IRepositoryFileStore>> repositoryStore = repositoryManager
......@@ -100,6 +92,7 @@ public class BonitaExplorerLabelProvider extends JavaNavigatorLabelProvider {
return super.getImage(element);
}
@Override
public StyledString getStyledText(Object element) {
RepositoryManager repositoryManager = RepositoryManager.getInstance();
......@@ -116,7 +109,7 @@ public class BonitaExplorerLabelProvider extends JavaNavigatorLabelProvider {
}
IRepositoryFileStore fStore = asFileStore(element, repositoryManager);
if (fStore != null) {
if (fStore != null && Objects.equals(fStore.getResource(), element)) {
return fStore.getStyledString();
}
}
......
......@@ -53,7 +53,8 @@ public class UIDArtifactFilters {
return element instanceof IFolder
&& ((IFolder) element).getParent() != null
&& Path.fromOSString(folderName).equals(((IFolder) element).getParent().getProjectRelativePath())
&& !((IFolder) element).getName().startsWith(".");
&& !((IFolder) element).getName().startsWith(".")
&& ((IFolder) element).getFile(((IFolder) element).getName() + ".json").exists();
}
private static boolean isAUIDFolder(Object element, String folderName) {
......
......@@ -122,8 +122,8 @@ public class RepositoryTest {
IRepositoryFileStore fileStore1 = mock(IRepositoryFileStore.class);
IRepositoryFileStore fileStore2 = mock(IRepositoryFileStore.class);
when(repositoryStore1.createRepositoryFileStore("name.xml")).thenReturn(fileStore1);
when(repositoryStore2.createRepositoryFileStore("name.xml")).thenReturn(fileStore2);
when(repositoryStore1.getChild("name.xml")).thenReturn(fileStore1);
when(repositoryStore2.getChild("name.xml")).thenReturn(fileStore2);
Repository repository = newRepository();
doReturn(Arrays.asList(repositoryStore1, repositoryStore2)).when(repository).getAllStores();
......
......@@ -260,13 +260,13 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
}
try {
projectManifestFactory.createProjectManifest(project, monitor);
connect(project);
initRepositoryStores(monitor);
bonitaBPMProjectClasspath.create(this, monitor);
enableBuild();
} catch (final CoreException e) {
BonitaStudioLog.error(e);
}
hookResourceListeners();
projectListeners.stream().forEach(l -> l.projectOpened(this, monitor));
if (migrationEnabled()) {
try {
......@@ -275,10 +275,15 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
BonitaStudioLog.error(e, CommonRepositoryPlugin.PLUGIN_ID);
}
}
hookResourceListeners();
updateCurrentRepositoryPreference();
return this;
}
protected void connect(IProject project) throws CoreException {
//May be implemented by sublcasses
}
protected void updateCurrentRepositoryPreference() {
CommonRepositoryPlugin.getDefault().getPreferenceStore().setValue(RepositoryPreferenceConstant.CURRENT_REPOSITORY,
getName());
......@@ -315,7 +320,8 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
}
protected void closeAllEditors() {
Display.getDefault().syncExec(() -> {
if (PlatformUI.isWorkbenchRunning()) {
Display.getDefault().syncExec(() -> {
final IWorkbenchWindow activeWorkbenchWindow = PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null
......@@ -326,7 +332,8 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
&& !(activeWorkbenchWindow.getActivePage().getActivePart() instanceof ViewIntroAdapterPart)) {
Display.getDefault().readAndDispatch();
}
});
});
}
}
protected synchronized void initRepositoryStores(final IProgressMonitor monitor) {
......@@ -584,7 +591,7 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
for (final IRepositoryStore<? extends IRepositoryFileStore> store : getAllStores()) {
IFolder container = store.getResource();
if (Objects.equals(resource.getParent(), container)) {
IRepositoryFileStore fStore = store.createRepositoryFileStore(resource.getName());
IRepositoryFileStore fStore = store.getChild(resource.getName());
if (fStore != null) {
return fStore;
}
......
......@@ -210,7 +210,7 @@ public abstract class AbstractFileStore
.findView("org.bonitasoft.studio.application.project.explorer");
if (viewPart != null) {
CommonViewer viewer = viewPart.getAdapter(CommonViewer.class);
if (viewer != null) {
if (viewer != null && !viewer.getTree().isDisposed()) {
viewer.refresh(true);
}
}
......
......@@ -137,18 +137,23 @@ public abstract class SourceRepositoryStore<T extends AbstractFileStore> extends
final IFolder packageFolder = packageStore.getResource();
final IFile file = packageFolder.getFile(className);
if (file.exists() && FileActionDialog.overwriteQuestion(fileName)) {
if (file.exists()) {
if (FileActionDialog.overwriteQuestion(fileName)) {
try {
file.delete(true, Repository.NULL_PROGRESS_MONITOR);
file.create(inputStream, true, Repository.NULL_PROGRESS_MONITOR);
} catch (final CoreException e) {
BonitaStudioLog.error(e);
}
}
} else {
try {
file.delete(true, Repository.NULL_PROGRESS_MONITOR);
file.create(inputStream, true, Repository.NULL_PROGRESS_MONITOR);
} catch (final CoreException e) {
BonitaStudioLog.error(e);
}
}
try {
file.create(inputStream, true, Repository.NULL_PROGRESS_MONITOR);
} catch (final CoreException e) {
BonitaStudioLog.error(e);
}
return createRepositoryFileStore(packageName);
}
......
......@@ -18,6 +18,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.bonitasoft.studio.common.Activator;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
......@@ -90,6 +92,14 @@ public class EMFModelUpdater<T extends EObject> {
.getEAllStructuralFeatures()
.stream()
.filter(EAttribute.class::isInstance)
.filter(feature -> {
if (!target.eClass().getEStructuralFeatures().contains(feature)) {
BonitaStudioLog.warning(String.format("Cannot update EObject value: %s does not have a %s feature.",
target.eClass().getName(), feature.getName()), Activator.PLUGIN_ID);
return false;
}
return true;
})
.forEach(feature -> source.eSet(feature, target.eGet(feature)));
source.eClass()
......
......@@ -34,7 +34,7 @@ public class CustomWizardDialog extends WizardDialog {
protected String finishLabel;
protected String closeLabel;
private boolean askWhenShellCloses = true && !FileActionDialog.getDisablePopup();
private boolean askWhenShellCloses = !FileActionDialog.getDisablePopup();
/**
* @param parentShell
......@@ -53,7 +53,8 @@ public class CustomWizardDialog extends WizardDialog {
public CustomWizardDialog(Shell parentShell, IWizard newWizard, String finishLabel,boolean isModal) {
super(parentShell, newWizard);
if(!isModal){
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.RESIZE | getDefaultOrientation());
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.RESIZE
| getDefaultOrientation());
}
this.finishLabel = finishLabel;
}
......
......@@ -39,8 +39,8 @@ public class GTKStyleHandler {
public static int replaceSingleWithWrap(int style) {
if (isGTK3()) {
style = style ^ SWT.SINGLE;
style = style | SWT.WRAP;
// style = style ^ SWT.SINGLE;
// style = style | SWT.WRAP;
return style;
}
return style;
......
......@@ -380,6 +380,7 @@ public class PageComponentSwitchBuilder {
viewer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 300).create());
viewer.addFilter(connectorExpressionContentTypeFilter);
viewer.setExpressionNameResolver(new ConnectorInputNameResolver(parameter.getKey()));
final Expression exp = (Expression) parameter.getExpression();
final String desc = getDescription(object.getId());
if (desc != null && !desc.isEmpty()) {
......
......@@ -61,6 +61,8 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
......@@ -123,7 +125,16 @@ public abstract class ConnectorSection extends AbstractBonitaDescriptionSection
tableViewer.addDoubleClickListener(this);
tableViewer.addSelectionChangedListener(this);
tableViewer.getTable().addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.DEL) {
e.doit = false;
removeSelectedConnectors();
}
}
});
tableViewer.setContentProvider(new EMFListFeatureTreeContentProvider(
getConnectorFeature()));
tableViewer.setLabelProvider(new StyledConnectorLabelProvider());
......@@ -174,50 +185,46 @@ public abstract class ConnectorSection extends AbstractBonitaDescriptionSection
}
}
/**
* @param buttonsComposite
* @return
*/
private Button createRemoveConnectorButton(final Composite buttonComposite) {
final Button removeButton = getWidgetFactory().createButton(
buttonComposite, Messages.removeData, SWT.FLAT);
removeButton.setLayoutData(GridDataFactory.fillDefaults()
.minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
removeButton.addListener(SWT.Selection, new Listener() {
removeButton.addListener(SWT.Selection, e -> removeSelectedConnectors());
return removeButton;
}
@Override
public void handleEvent(final Event event) {
if (tableViewer != null
&& ((IStructuredSelection) tableViewer.getSelection())
.size() > 0) {
final List<?> selection = ((IStructuredSelection) tableViewer
.getSelection()).toList();
if (MessageDialog.openConfirm(buttonComposite.getShell(),
Messages.deleteDialogTitle, createMessage())) {
getEditingDomain().getCommandStack().execute(
new RemoveCommand(getEditingDomain(),
getEObject(), getConnectorFeature(),
selection));
tableViewer.refresh();
}
}
protected void removeSelectedConnectors() {
if (tableViewer != null
&& ((IStructuredSelection) tableViewer.getSelection())
.size() > 0) {
final List<?> selection = ((IStructuredSelection) tableViewer
.getSelection()).toList();
if (MessageDialog.openConfirm(Display.getDefault().getActiveShell(),
Messages.deleteDialogTitle, createMessage())) {
getEditingDomain().getCommandStack().execute(
new RemoveCommand(getEditingDomain(),
getEObject(), getConnectorFeature(),
selection));
tableViewer.refresh();
}
}
}
public String createMessage() {
final Object[] selection = ((IStructuredSelection) tableViewer
.getSelection()).toArray();
final StringBuilder res = new StringBuilder(
Messages.deleteDialogConfirmMessage);
res.append(' ');
res.append(((Connector) selection[0]).getName());
for (int i = 1; i < selection.length; i++) {
res.append(", ");res.append(((Connector) selection[i]).getName()); //$NON-NLS-1$
}
res.append(" ?"); //$NON-NLS-1$
return res.toString();
}
});
return removeButton;
public String createMessage() {
final Object[] selection = ((IStructuredSelection) tableViewer
.getSelection()).toArray();
final StringBuilder res = new StringBuilder(
Messages.deleteDialogConfirmMessage);
res.append(' ');
res.append(((Connector) selection[0]).getName());
for (int i = 1; i < selection.length; i++) {
res.append(", "); //$NON-NLS-1$