Commit 08496f4d authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

feat(accessControl) enables refactoring (#883)

* track bdm model changes in a history log
* apply all changes to access control model on model changes commit

Closes BS-17294
parent 59bfdc41
......@@ -3,10 +3,12 @@ Bundle-ManifestVersion: 2
Bundle-Name: Business Object Plugin
Bundle-SymbolicName: org.bonitasoft.studio.businessobject;singleton:=true
Bundle-Version: 7.7.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.bonitasoft.studio.businessobject.BusinessObjectPlugin
Bundle-Vendor: BonitaSoft S.A.
Bundle-Localization: plugin
Export-Package: org.bonitasoft.studio.businessobject,
org.bonitasoft.studio.businessobject.core.difflog,
org.bonitasoft.studio.businessobject.core.operation,
org.bonitasoft.studio.businessobject.core.repository,
org.bonitasoft.studio.businessobject.i18n;x-friends:="org.bonitasoft.studio.tests",
......@@ -57,7 +59,8 @@ Require-Bundle: org.bonitasoft.studio.engine;bundle-version="1.0.0",
org.eclipse.debug.core,
org.eclipse.core.externaltools;bundle-version="1.0.300",
org.eclipse.debug.ui,
org.bonitasoft.studio.ui;bundle-version="7.5.0"
org.bonitasoft.studio.ui;bundle-version="7.5.0",
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.bonitasoft.engine.api,
......
......@@ -82,4 +82,6 @@
</fragment>
</extension>
</plugin>
......@@ -65,17 +65,18 @@ public class ManageBusinessObjectHandlerTest {
public void setUp() throws Exception {
Mockito.doReturn(businessStore).when(repositoryAccessor)
.getRepositoryStore(BusinessObjectModelRepositoryStore.class);
Mockito.doReturn(wizard).when(handlerUnderTest).createWizard();
Mockito.doReturn(wizard).when(handlerUnderTest).createWizard(repositoryAccessor);
when(wizardDialog.open()).thenReturn(IDialogConstants.OK_ID);
Mockito.doReturn(wizardDialog).when(handlerUnderTest).createWizardDialog(wizard, IDialogConstants.FINISH_LABEL);
doNothing().when(handlerUnderTest).openSuccessDialog();
Mockito.doReturn(wizardDialog).when(handlerUnderTest).createWizardDialog(wizard, IDialogConstants.FINISH_LABEL,
shell);
doNothing().when(handlerUnderTest).openSuccessDialog(shell);
}
@Test
public void shouldExecute_SaveArtifactWithEditorContent() throws Exception {
assertThat(handlerUnderTest.execute(repositoryAccessor, shell)).isEqualTo(IDialogConstants.OK_ID);
verify(wizardDialog).open();
verify(handlerUnderTest).openSuccessDialog();
verify(handlerUnderTest).openSuccessDialog(shell);
}
}
......@@ -20,6 +20,7 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import org.bonitasoft.engine.bdm.model.BusinessObjectModel;
import org.bonitasoft.studio.businessobject.core.difflog.NullDiffLogger;
import org.bonitasoft.studio.swt.rules.RealmWithDisplay;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
......@@ -48,7 +49,7 @@ public class BusinessDataModelWizardPageTest {
*/
@Before
public void setUp() throws Exception {
wizardPage = spy(new BusinessDataModelWizardPage(businessObjectModel));
wizardPage = spy(new BusinessDataModelWizardPage(businessObjectModel, new NullDiffLogger()));
}
@Test
......
......@@ -20,6 +20,7 @@ import java.util.List;
import org.bonitasoft.engine.bdm.model.BusinessObjectModel;
import org.bonitasoft.engine.bdm.model.field.FieldType;
import org.bonitasoft.studio.businessobject.core.difflog.NullDiffLogger;
import org.bonitasoft.studio.businessobject.ui.wizard.provider.FieldTypeLabelProvider;
import org.bonitasoft.studio.swt.rules.RealmWithDisplay;
import org.eclipse.core.databinding.observable.list.WritableList;
......@@ -54,7 +55,7 @@ public class FieldTypeEditingSupportTest {
private FieldTypeEditingSupport createEditingSupport() {
return new FieldTypeEditingSupport(new TableViewer(realm.createComposite()), new BusinessObjectModel(),
new WritableList(), new WritableValue());
new WritableList(), new WritableValue(), new WritableValue(), new NullDiffLogger());
}
}
/**
* Copyright (C) 2017 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.businessobject.core.difflog;
import org.bonitasoft.engine.bdm.model.field.RelationField.Type;
public interface IDiffLogger {
void boAdded(String qualifiedName);
void boRemoved(String qualifiedName);
void boRenamed(String oldQualifiedName, String newQualifiedName);
void fieldAdded(String qualifiedName, String fieldName);
void fieldRenamed(String qualifiedName, String oldValue, String newValue);
void fieldTypeChanged(String qualifiedName, String fieldName, Object oldType, Object newType);
void fieldRelationTypeChanged(String qualifiedName, String fieldName, String referencedType, Type oldType, Type newType);
void fieldRemoved(String qualifiedName, String fieldName);
}
/**
* Copyright (C) 2017 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.businessobject.core.difflog;
import org.bonitasoft.engine.bdm.model.field.RelationField.Type;
public class NullDiffLogger implements IDiffLogger {
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#boAdded(java.lang.String)
*/
@Override
public void boAdded(String qualifiedName) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#boRemoved(java.lang.String)
*/
@Override
public void boRemoved(String qualifiedName) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#boRenamed(java.lang.String, java.lang.String)
*/
@Override
public void boRenamed(String oldQualifiedName, String newQualifiedName) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#fieldAdded(java.lang.String, java.lang.String)
*/
@Override
public void fieldAdded(String qualifiedName, String fieldName) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#fieldRenamed(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public void fieldRenamed(String qualifiedName, String oldValue, String newValue) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#fieldTypeChanged(java.lang.String, java.lang.String, java.lang.Object,
* java.lang.Object)
*/
@Override
public void fieldTypeChanged(String qualifiedName, String fieldName, Object oldType, Object newType) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#fieldRelationTypeChanged(java.lang.String, java.lang.String,
* org.bonitasoft.engine.bdm.model.field.RelationField.Type, org.bonitasoft.engine.bdm.model.field.RelationField.Type)
*/
@Override
public void fieldRelationTypeChanged(String qualifiedName, String fieldName, String referencedType, Type oldType,
Type newType) {
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger#fieldRemoved(java.lang.String, java.lang.String)
*/
@Override
public void fieldRemoved(String qualifiedName, String fieldName) {
}
}
......@@ -15,6 +15,7 @@
package org.bonitasoft.studio.businessobject.ui.handler;
import org.bonitasoft.studio.businessobject.BusinessObjectPlugin;
import org.bonitasoft.studio.businessobject.core.difflog.NullDiffLogger;
import org.bonitasoft.studio.businessobject.core.repository.BusinessObjectModelFileStore;
import org.bonitasoft.studio.businessobject.core.repository.BusinessObjectModelRepositoryStore;
import org.bonitasoft.studio.businessobject.i18n.Messages;
......@@ -41,23 +42,20 @@ import org.eclipse.swt.widgets.ToolItem;
public class ManageBusinessObjectHandler {
private static final String DO_NOT_SHOW_INSTALL_MESSAGE_DIALOG = "DO_NOT_SHOW_INSTALL_MESSAGE_DIALOG";
private Shell shell;
private BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> repositoryStore;
@Execute
public Object execute(RepositoryAccessor repositoryAccessor, Shell shell) throws ExecutionException {
this.repositoryStore = repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class);
this.shell = shell;
final ManageBusinessDataModelWizard newBusinessDataModelWizard = createWizard();
final CustomWizardDialog dialog = createWizardDialog(newBusinessDataModelWizard, IDialogConstants.FINISH_LABEL);
final ManageBusinessDataModelWizard newBusinessDataModelWizard = createWizard(repositoryAccessor);
final CustomWizardDialog dialog = createWizardDialog(newBusinessDataModelWizard, IDialogConstants.FINISH_LABEL,
shell);
if (dialog.open() == IDialogConstants.OK_ID) {
openSuccessDialog();
openSuccessDialog(shell);
return IDialogConstants.OK_ID;
}
return IDialogConstants.CANCEL_ID;
}
protected void openSuccessDialog() {
protected void openSuccessDialog(Shell shell) {
final IPreferenceStore preferenceStore = BusinessObjectPlugin.getDefault().getPreferenceStore();
if (!preferenceStore.getBoolean(DO_NOT_SHOW_INSTALL_MESSAGE_DIALOG)) {
MessageDialogWithPrompt.openWithDetails(MessageDialog.INFORMATION,
......@@ -73,7 +71,7 @@ public class ManageBusinessObjectHandler {
}
}
protected CustomWizardDialog createWizardDialog(final IWizard wizard, final String finishLabel) {
protected CustomWizardDialog createWizardDialog(final IWizard wizard, final String finishLabel, Shell shell) {
final CustomWizardDialog dialog = new CustomWizardDialog(shell, wizard, finishLabel) {
@Override
......@@ -91,13 +89,20 @@ public class ManageBusinessObjectHandler {
return dialog;
}
protected ManageBusinessDataModelWizard createWizard() {
BusinessObjectModelFileStore fileStore = repositoryStore.getChild(BusinessObjectModelFileStore.BOM_FILENAME);
protected ManageBusinessDataModelWizard createWizard(RepositoryAccessor repositoryAccessor) {
return new ManageBusinessDataModelWizard(getFileStore(repositoryAccessor), new NullDiffLogger());
}
protected BusinessObjectModelFileStore getFileStore(RepositoryAccessor repositoryAccessor) {
BusinessObjectModelRepositoryStore repositoryStore = repositoryAccessor
.getRepositoryStore(BusinessObjectModelRepositoryStore.class);
BusinessObjectModelFileStore fileStore = (BusinessObjectModelFileStore) repositoryStore
.getChild(BusinessObjectModelFileStore.BOM_FILENAME);
if (fileStore == null) {
fileStore = (BusinessObjectModelFileStore) repositoryStore
.createRepositoryFileStore(BusinessObjectModelFileStore.BOM_FILENAME);
}
return new ManageBusinessDataModelWizard(fileStore);
return fileStore;
}
}
......@@ -24,6 +24,7 @@ import org.bonitasoft.engine.bdm.model.BusinessObject;
import org.bonitasoft.engine.bdm.model.BusinessObjectModel;
import org.bonitasoft.engine.bdm.model.Query;
import org.bonitasoft.studio.businessobject.BusinessObjectPlugin;
import org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger;
import org.bonitasoft.studio.businessobject.i18n.Messages;
import org.bonitasoft.studio.businessobject.ui.wizard.control.AttributesTabItemControl;
import org.bonitasoft.studio.businessobject.ui.wizard.control.IndexesTabItemControl;
......@@ -101,9 +102,12 @@ public class BusinessDataModelWizardPage extends WizardPage {
private TableViewer boTableViewer;
protected BusinessDataModelWizardPage(final BusinessObjectModel businessObjectModel) {
private IDiffLogger diffLogger;
protected BusinessDataModelWizardPage(final BusinessObjectModel businessObjectModel, IDiffLogger diffLogger) {
super(BusinessDataModelWizardPage.class.getName());
this.businessObjectModel = businessObjectModel;
this.diffLogger = diffLogger;
}
/*
......@@ -153,7 +157,7 @@ public class BusinessDataModelWizardPage extends WizardPage {
viewerObservableValue, PojoObservables.observeValue(
this, "packageName"),
groupTextObservable,
boTableViewer, ctx));
boTableViewer, ctx, diffLogger));
ctx.bindValue(observeDetailValue,
groupTextObservable,
updateValueStrategy().withConverter(toPaneDescripitonlTitle()).create(),
......@@ -184,7 +188,8 @@ public class BusinessDataModelWizardPage extends WizardPage {
final TabItem attributeItem = new TabItem(tabFolder, SWT.BORDER);
attributeItem.setText(Messages.attributes);
attributeItem.setControl(
new AttributesTabItemControl(tabFolder, ctx, viewerObservableValue, fieldsList, businessObjectModel));
new AttributesTabItemControl(tabFolder, ctx, viewerObservableValue, fieldsList, businessObjectModel,
diffLogger));
}
protected void createConstraintsTabItem(final DataBindingContext ctx, final IViewerObservableValue viewerObservableValue,
......@@ -362,11 +367,12 @@ public class BusinessDataModelWizardPage extends WizardPage {
});
final IObservableValue packageNameObserveValue = PojoObservables.observeValue(this, "packageName");
final ISWTObservableValue packageNameObserveText = SWTObservables.observeText(packageNameText, SWT.Modify);
ctx.bindValue(packageNameObserveText, packageNameObserveValue, targetToModel, null);
packageNameObserveText.addValueChangeListener(new IValueChangeListener() {
ctx.bindValue(SWTObservables.observeDelayedValue(200, packageNameObserveText), packageNameObserveValue,
targetToModel, null);
packageNameObserveValue.addValueChangeListener(new IValueChangeListener<String>() {
@Override
public void handleValueChange(final ValueChangeEvent event) {
public void handleValueChange(ValueChangeEvent<? extends String> event) {
String newPackageName = (String) event.diff.getNewValue();
if (newPackageName.isEmpty()) {
newPackageName = DEFAULT_PACKAGE_NAME;
......@@ -377,14 +383,15 @@ public class BusinessDataModelWizardPage extends WizardPage {
for (final BusinessObject bo : businessObjectModel.getBusinessObjects()) {
final String previousName = bo.getQualifiedName();
final String qualifiedName = newPackageName + "." + NamingUtils.getSimpleName(bo.getQualifiedName());
diffLogger.boRenamed(bo.getQualifiedName(), qualifiedName);
bo.setQualifiedName(qualifiedName);
for (final Query q : bo.getQueries()) {
if (previousName.equals(q.getReturnType())) {
q.setReturnType(qualifiedName);
}
}
}
}
});
if (businessObjectModel.getBusinessObjects().isEmpty()) {
......@@ -399,6 +406,7 @@ public class BusinessDataModelWizardPage extends WizardPage {
final BusinessObject businessObject = new BusinessObject();
businessObject.setQualifiedName(generateObjectName());
businessObjectsObserveList.add(businessObject);
diffLogger.boAdded(businessObject.getQualifiedName());
boTableViewer.getControl().getDisplay().asyncExec(new Runnable() {
@Override
......@@ -437,6 +445,7 @@ public class BusinessDataModelWizardPage extends WizardPage {
Messages.bind(Messages.deleteBOConfirmMessage, NamingUtils.getSimpleName(bo.getQualifiedName())))) {
for (final Object selected : selection.toList()) {
businessObjectsObserveList.remove(selected);
diffLogger.boRemoved(((BusinessObject) selected).getQualifiedName());
}
if (businessObjectsObserveList.isEmpty()) {
observeSingleSelection.setValue(null);
......
......@@ -27,6 +27,7 @@ import org.bonitasoft.engine.bdm.model.UniqueConstraint;
import org.bonitasoft.engine.bdm.model.field.Field;
import org.bonitasoft.engine.bdm.validator.BusinessObjectModelValidator;
import org.bonitasoft.engine.bdm.validator.ValidationStatus;
import org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger;
import org.bonitasoft.studio.businessobject.core.operation.DeployBDMOperation;
import org.bonitasoft.studio.businessobject.core.repository.BusinessObjectModelFileStore;
import org.bonitasoft.studio.businessobject.i18n.Messages;
......@@ -63,13 +64,16 @@ public class ManageBusinessDataModelWizard extends Wizard {
private boolean newBdm = false;
public ManageBusinessDataModelWizard(final BusinessObjectModelFileStore fStore) {
private IDiffLogger diffLogger;
public ManageBusinessDataModelWizard(final BusinessObjectModelFileStore fStore, IDiffLogger diffLogger) {
this.fStore = fStore;
businessObjectModel = fStore.getContent();
if (businessObjectModel == null) {
newBdm = true;
businessObjectModel = new BusinessObjectModel();
}
this.diffLogger = diffLogger;
setDefaultPageImageDescriptor(Pics.getWizban());
setWindowTitle(Messages.manageBusinessDataModelTitle);
setNeedsProgressMonitor(true);
......@@ -81,7 +85,7 @@ public class ManageBusinessDataModelWizard extends Wizard {
*/
@Override
public void addPages() {
page = new BusinessDataModelWizardPage(businessObjectModel);
page = new BusinessDataModelWizardPage(businessObjectModel, diffLogger);
page.setTitle(Messages.manageBusinessDataModelTitle);
page.setDescription(Messages.manageBusinessDataModelDesc);
addPage(page);
......@@ -161,12 +165,12 @@ public class ManageBusinessDataModelWizard extends Wizard {
});
throw new InterruptedException();
} else {
monitor.setTaskName(Messages.saving);
fStore.save(businessObjectModel);
monitor.done();
save(monitor);
}
monitor.done();
}
}
});
} catch (final InvocationTargetException e) {
MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.modelValidationFailedTitle,
......@@ -179,7 +183,12 @@ public class ManageBusinessDataModelWizard extends Wizard {
return true;
}
private boolean installBDM() {
protected void save(final IProgressMonitor monitor) {
monitor.setTaskName(Messages.saving);
fStore.save(businessObjectModel);
}
protected boolean installBDM() {
try {
getContainer().run(true, false, new IRunnableWithProgress() {
......@@ -200,6 +209,10 @@ public class ManageBusinessDataModelWizard extends Wizard {
return true;
}
protected IDiffLogger getDiffLogger() {
return diffLogger;
}
private Throwable handleTargetExceptionStacktrace(final InvocationTargetException e) {
final Throwable targetException = e.getTargetException();
int index = -1;
......
......@@ -5,20 +5,18 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.businessobject.ui.wizard.control;
import org.bonitasoft.engine.bdm.model.BusinessObject;
import org.bonitasoft.studio.businessobject.i18n.Messages;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.jface.databinding.viewers.IViewerObservableValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
......@@ -28,7 +26,6 @@ import org.eclipse.swt.widgets.TabFolder;
/**
* @author Romain Bioteau
*
*/
public abstract class AbstractTabItemControl extends Composite {
......@@ -36,9 +33,10 @@ public abstract class AbstractTabItemControl extends Composite {
super(parent, style);
}
protected Button createAddButton(DataBindingContext ctx, final IViewerObservableValue viewerObservableValue, final Composite buttonsComposite) {
protected Button createAddButton(final Composite buttonsComposite) {
final Button addButton = new Button(buttonsComposite, SWT.FLAT);
addButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
addButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
.minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
addButton.setText(Messages.add);
addButton.setEnabled(false);
return addButton;
......@@ -46,23 +44,28 @@ public abstract class AbstractTabItemControl extends Composite {
protected Button createDeleteButton(final Composite buttonsComposite) {
final Button deleteButton = new Button(buttonsComposite, SWT.FLAT);
deleteButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
deleteButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
.minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
deleteButton.setText(Messages.delete);
deleteButton.setEnabled(false);
return deleteButton;
}
protected Button createDownButton(final IViewerObservableValue viewerObservableValue, final Composite buttonsComposite) {
protected Button createDownButton(final IObservableValue<BusinessObject> viewerObservableValue,
final Composite buttonsComposite) {
final Button downButton = new Button(buttonsComposite, SWT.FLAT);
downButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
downButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
.minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
downButton.setText(Messages.down);
downButton.setEnabled(viewerObservableValue.getValue() != null);
return downButton;
}
protected Button createUpButton(final IViewerObservableValue viewerObservableValue, final Composite buttonsComposite) {
protected Button createUpButton(final IObservableValue<BusinessObject> viewerObservableValue,
final Composite buttonsComposite) {
final Button upButton = new Button(buttonsComposite, SWT.FLAT);
upButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
upButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
.minSize(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).create());
upButton.setText(Messages.up);
upButton.setEnabled(viewerObservableValue.getValue() != null);
return upButton;
......
......@@ -28,6 +28,7 @@ import org.bonitasoft.engine.bdm.model.field.RelationField;
import org.bonitasoft.engine.bdm.model.field.RelationField.FetchType;
import org.bonitasoft.engine.bdm.model.field.RelationField.Type;
import org.bonitasoft.engine.bdm.model.field.SimpleField;
import org.bonitasoft.studio.businessobject.core.difflog.IDiffLogger;
import org.bonitasoft.studio.businessobject.i18n.Messages;
import org.bonitasoft.studio.businessobject.ui.DateTypeLabels;
import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.FieldNameEditingSupport;
......@@ -84,7 +85,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;