Commit 9583ece1 authored by Romain Bioteau's avatar Romain Bioteau

Merge remote-tracking branch 'origin/master' into dev

Conflicts:
	community/bundles/plugins/org.bonitasoft.studio.diagram.custom/src/org/bonitasoft/studio/diagram/custom/parts/CustomPoolEditPart.java
	community/bundles/plugins/org.bonitasoft.studio.diagram.custom/src/org/bonitasoft/studio/diagram/custom/providers/CustomProcessViewProvider.java
parents fe3544cb cae6d64f
......@@ -18,6 +18,7 @@ import java.lang.reflect.InvocationTargetException;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.diagram.custom.parts.CustomPoolEditPart;
import org.bonitasoft.studio.diagram.custom.repository.DiagramFileStore;
import org.bonitasoft.studio.diagram.custom.repository.NewDiagramFactory;
import org.bonitasoft.studio.model.process.ProcessPackage;
......@@ -61,7 +62,7 @@ public class NewDiagramCommandHandler extends AbstractHandler {
final NewDiagramFactory diagramFactory = new NewDiagramFactory(
RepositoryManager.getInstance().getCurrentRepository(),
BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore());
diagramFactory.setDefaultPoolWidth(getDefaultWidth());
diagramFactory.setDefaultPoolWidth(CustomPoolEditPart.getDefaultWidth());
final IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
try {
progressService.run(true, false, new IRunnableWithProgress() {
......@@ -81,14 +82,6 @@ public class NewDiagramCommandHandler extends AbstractHandler {
return diagramFileStore;
}
private int getDefaultWidth() {
if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null
&& PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() != null) {
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getClientArea().width - 600;
}
return 800;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#isEnabled()
......
......@@ -71,7 +71,7 @@ public class CustomPoolEditPart extends PoolEditPart {
&& PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null
&& PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() != null) {
return ((DiagramEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor()).getDiagramGraphicalViewer().getControl().getBounds().width;
.getActiveEditor()).getDiagramGraphicalViewer().getControl().getBounds().width - 100;
} else {
return MIN_POOL_WIDTH;
}
......
......@@ -62,7 +62,7 @@ public class CustomProcessViewProvider extends ProcessViewProvider {
node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle());
final Size layoutConstraint = (Size) node.getLayoutConstraint();
if (layoutConstraint.getWidth() <= 0) {
layoutConstraint.setWidth(CustomPoolEditPart.getDefaultWidth());
layoutConstraint.setWidth(((IPreferenceStore) preferencesHint.getPreferenceStore()).getDefaultInt("poolDefaultWidth"));
layoutConstraint.setHeight(CustomPoolEditPart.CONSTANT_DEFAULT_HEIGHT);
}
return node;
......
......@@ -202,9 +202,6 @@ public class NewDiagramFactory {
return mapping;
}
/**
* @return the artifact
*/
public DiagramFileStore getNewDiagramFileStore() {
return fileStore;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment