Commit 8c19d197 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

Revert "BS-10726"

This reverts commit 69430f4a39d37564d93e468d3eefc0845588e422.
parent 5f8ea2d0
...@@ -443,7 +443,8 @@ public class PageComponentSwitchBuilder { ...@@ -443,7 +443,8 @@ public class PageComponentSwitchBuilder {
if (parameter != null) { if (parameter != null) {
createFieldLabel(composite, SWT.CENTER, object.getId(), input.isMandatory()); createFieldLabel(composite, SWT.CENTER, object.getId(), input.isMandatory());
final ExpressionViewer viewer = new GroovyOnlyExpressionViewer(composite, SWT.BORDER | SWT.SHORT); final ExpressionViewer viewer = new GroovyOnlyExpressionViewer(composite, SWT.BORDER,
ConnectorConfigurationPackage.Literals.CONNECTOR_PARAMETER__EXPRESSION);
viewer.setIsPageFlowContext(isPageFlowContext); viewer.setIsPageFlowContext(isPageFlowContext);
viewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); viewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
viewer.setContext(container); viewer.setContext(container);
......
...@@ -215,16 +215,4 @@ ...@@ -215,16 +215,4 @@
name="DBConnectors"> name="DBConnectors">
</page> </page>
</extension> </extension>
<extension
point="org.bonitasoft.studio.connectors.connectorWizard">
<connectorWizard
DefinitionId="scripting-groovy-script"
priority="1"
useDefaultGeneratedPages="false"
useDefaultOutputPage="true">
<configurationPage
page="org.bonitasoft.studio.connectors.ui.wizard.custom.GroovyScriptConfigurationWizardPage">
</configurationPage>
</connectorWizard>
</extension>
</plugin> </plugin>
...@@ -400,13 +400,6 @@ ...@@ -400,13 +400,6 @@
<classifier>connector</classifier> <classifier>connector</classifier>
<type>zip</type> <type>zip</type>
</artifactItem> </artifactItem>
<artifactItem>
<groupId>org.bonitasoft.connectors</groupId>
<artifactId>bonita-connector-scripting-groovy-script-impl</artifactId>
<version>1.0.0</version>
<classifier>connector</classifier>
<type>zip</type>
</artifactItem>
<artifactItem> <artifactItem>
<groupId>org.bonitasoft.connectors</groupId> <groupId>org.bonitasoft.connectors</groupId>
<artifactId>bonita-connector-scripting-shell-impl</artifactId> <artifactId>bonita-connector-scripting-shell-impl</artifactId>
......
...@@ -83,7 +83,8 @@ public class GroovyScriptConfigurationWizardPage extends AbstractConnectorConfig ...@@ -83,7 +83,8 @@ public class GroovyScriptConfigurationWizardPage extends AbstractConnectorConfig
final ConnectorParameter dependenciesParameter = getConnectorParameter(getInput(DEPENDENCIES_INPUT_NAME)); final ConnectorParameter dependenciesParameter = getConnectorParameter(getInput(DEPENDENCIES_INPUT_NAME));
final ConnectorParameter parameter = buildScriptConnectorParameter(); final ConnectorParameter parameter = buildScriptConnectorParameter();
builder.createFieldLabel(composite, SWT.CENTER, SCRIPT_INPUT_NAME, true); builder.createFieldLabel(composite, SWT.CENTER, SCRIPT_INPUT_NAME, true);
final ExpressionViewer viewer = new GroovyOnlyExpressionViewer(composite, SWT.BORDER | SWT.SHORT); final ExpressionViewer viewer = new GroovyOnlyExpressionViewer(composite, SWT.BORDER,
ConnectorConfigurationPackage.Literals.CONNECTOR_PARAMETER__EXPRESSION);
viewer.setIsPageFlowContext(isPageFlowContext()); viewer.setIsPageFlowContext(isPageFlowContext());
viewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); viewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
viewer.setContext(getElementContainer()); viewer.setContext(getElementContainer());
......
...@@ -68,7 +68,7 @@ public class DocumentWizardPageTest { ...@@ -68,7 +68,7 @@ public class DocumentWizardPageTest {
doReturn(expressionViewerMock).when(documentWizardPageUnderTest).createExpressionViewer(Mockito.any(Composite.class), Mockito.any(EReference.class)); doReturn(expressionViewerMock).when(documentWizardPageUnderTest).createExpressionViewer(Mockito.any(Composite.class), Mockito.any(EReference.class));
when(groovyOnlyExpressionViewerMock.getControl()).thenReturn(mock(Control.class)); when(groovyOnlyExpressionViewerMock.getControl()).thenReturn(mock(Control.class));
doReturn(groovyOnlyExpressionViewerMock).when(documentWizardPageUnderTest).createExpressionViewerWithGroovyScriptOnly(Mockito.any(Composite.class)); doReturn(groovyOnlyExpressionViewerMock).when(documentWizardPageUnderTest).createExpressionViewerWitrhGroovyScriptOnly(Mockito.any(Composite.class));
} }
...@@ -99,7 +99,7 @@ public class DocumentWizardPageTest { ...@@ -99,7 +99,7 @@ public class DocumentWizardPageTest {
@Test @Test
public void should_createDocumentInitialMultipleContent_should_create_ExpressionViwer_with_filter_accepting_only_Groovy_script() throws Exception { public void should_createDocumentInitialMultipleContent_should_create_ExpressionViwer_with_filter_accepting_only_Groovy_script() throws Exception {
documentWizardPageUnderTest.createDocumentInitialMultipleContent(mock(Composite.class)); documentWizardPageUnderTest.createDocumentInitialMultipleContent(mock(Composite.class));
verify(documentWizardPageUnderTest).createExpressionViewerWithGroovyScriptOnly(Mockito.any(Composite.class)); verify(documentWizardPageUnderTest).createExpressionViewerWitrhGroovyScriptOnly(Mockito.any(Composite.class));
} }
} }
...@@ -259,8 +259,9 @@ public class DocumentWizardPage extends WizardPage { ...@@ -259,8 +259,9 @@ public class DocumentWizardPage extends WizardPage {
return new ExpressionViewer(parent, SWT.BORDER); return new ExpressionViewer(parent, SWT.BORDER);
} }
protected GroovyOnlyExpressionViewer createExpressionViewerWithGroovyScriptOnly(final Composite parent) { protected GroovyOnlyExpressionViewer createExpressionViewerWitrhGroovyScriptOnly(final Composite parent) {
return new GroovyOnlyExpressionViewer(parent, SWT.READ_ONLY | SWT.BORDER); return new GroovyOnlyExpressionViewer(parent, SWT.READ_ONLY | SWT.BORDER,
ProcessPackage.Literals.DOCUMENT__INITIAL_MULTIPLE_CONTENT);
} }
private void createDocumentManageMimeTypeLink(final Composite detailsComposite) { private void createDocumentManageMimeTypeLink(final Composite detailsComposite) {
...@@ -407,7 +408,7 @@ public class DocumentWizardPage extends WizardPage { ...@@ -407,7 +408,7 @@ public class DocumentWizardPage extends WizardPage {
} }
protected void createDocumentInitialMultipleContent(final Composite parent) { protected void createDocumentInitialMultipleContent(final Composite parent) {
multipleInitialContentExpressionViewer = createExpressionViewerWithGroovyScriptOnly(parent); multipleInitialContentExpressionViewer = createExpressionViewerWitrhGroovyScriptOnly(parent);
multipleInitialContentExpressionViewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); multipleInitialContentExpressionViewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
multipleInitialContentExpressionViewer.setInput(document); multipleInitialContentExpressionViewer.setInput(document);
} }
......
...@@ -30,16 +30,16 @@ import org.eclipse.swt.widgets.Shell; ...@@ -30,16 +30,16 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class GroovyOnlyEditExpressionDialog extends EditExpressionDialog { public class GroovyOnlyEditExpressionDialog extends EditExpressionDialog {
protected GroovyOnlyEditExpressionDialog(final Shell parentShell,final boolean isPassword, final Expression inputExpression,final EObject context,final EditingDomain domain, final ViewerFilter[] viewerTypeFilters,final ExpressionViewer expressionViewer) { protected GroovyOnlyEditExpressionDialog(Shell parentShell,boolean isPassword, Expression inputExpression,EObject context,EditingDomain domain, ViewerFilter[] viewerTypeFilters,ExpressionViewer expressionViewer) {
super(parentShell,isPassword,inputExpression,context,domain,viewerTypeFilters,expressionViewer); super(parentShell,isPassword,inputExpression,context,domain,viewerTypeFilters,expressionViewer);
this.inputExpression.setType(ExpressionConstants.SCRIPT_TYPE) ; this.inputExpression.setType(ExpressionConstants.SCRIPT_TYPE) ;
} }
@Override @Override
protected void createExpressionTypePanel(final Composite parentForm) { protected void createExpressionTypePanel(Composite parentForm) {
} }
@Override @Override
public void create() { public void create() {
super.create(); super.create();
...@@ -47,9 +47,4 @@ public class GroovyOnlyEditExpressionDialog extends EditExpressionDialog { ...@@ -47,9 +47,4 @@ public class GroovyOnlyEditExpressionDialog extends EditExpressionDialog {
getShell().layout(true,true); getShell().layout(true,true);
} }
public void setShowScriptHeader(final boolean displayHeader) {
// TODO Auto-generated method stub
}
} }
...@@ -18,9 +18,9 @@ package org.bonitasoft.studio.expression.editor.viewer; ...@@ -18,9 +18,9 @@ package org.bonitasoft.studio.expression.editor.viewer;
import org.bonitasoft.studio.common.ExpressionConstants; import org.bonitasoft.studio.common.ExpressionConstants;
import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
/** /**
...@@ -29,22 +29,16 @@ import org.eclipse.swt.widgets.Composite; ...@@ -29,22 +29,16 @@ import org.eclipse.swt.widgets.Composite;
*/ */
public class GroovyOnlyExpressionViewer extends ExpressionViewer { public class GroovyOnlyExpressionViewer extends ExpressionViewer {
private final boolean displayHeader; public GroovyOnlyExpressionViewer(final Composite composite, final int style,final EReference expressionReference) {
super(composite, style, expressionReference);
public GroovyOnlyExpressionViewer(final Composite composite, final int style) {
super(composite, style);
displayHeader = (style & SWT.SHORT) == 0;
getContentAssistText().getToolbar().getItem(0).setEnabled(false); getContentAssistText().getToolbar().getItem(0).setEnabled(false);
} }
@Override @Override
protected EditExpressionDialog createEditDialog(final EObject editInput) { protected EditExpressionDialog createEditDialog(final EObject editInput) {
final GroovyOnlyEditExpressionDialog groovyOnlyEditExpressionDialog = new GroovyOnlyEditExpressionDialog(control.getShell(), isPassword, return new GroovyOnlyEditExpressionDialog(control.getShell(), isPassword, EcoreUtil.copy(getSelectedExpression()), editInput, getEditingDomain(),
EcoreUtil.copy(getSelectedExpression()), editInput, getEditingDomain(),
filters.toArray(new ViewerFilter[filters.size()]), this); filters.toArray(new ViewerFilter[filters.size()]), this);
groovyOnlyEditExpressionDialog.setShowScriptHeader(displayHeader);
return groovyOnlyEditExpressionDialog;
} }
@Override @Override
......
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