Commit cfe00c70 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

show content assist hint

parent 3dd37c2c
contractSectionDescription=Define a contract for this step or pool instanciation.
contractSectionDescription=Define a contract for this step or pool instantiation.
name=Name
type=Type
mandatory=Mandatory
......@@ -31,7 +31,8 @@ expression=Expression
errorMessage=Error message
noInputReferencedInConstraintExpression=No input is referenced in the expression of constraint: {0}
unknownInputReferencedInConstraintExpression=Unknown input \"{0}\" is referenced in the expression of {1}
constraintEditorDescription=Type the constraint using MVEL scripting.\nUse Ctrl+Space fot content assist.
constraintEditorDescription=Type the constraint using MVEL scripting.
contentAssistHint=Use \"Ctrl + Space\" to trigger content assist.
addContentToConstraint=Add content to constraint {0}
editContentToConstraint=Edit content to constraint {0}
emptyExpressionContent=Empty expression content
......@@ -41,4 +42,4 @@ removeInputErrorTitle=Remove failed
removeInputErrorMsg=An error occurred when removing contract input.
severalCompilationErrors={0} compilation errors found.
SelectBusinessDataWizardPageTitle=Select business data
selectBusinessDataWizardPageDescription=Select business data from wich contract input will be generated.
selectBusinessDataWizardPageDescription=Select business data from which contract input will be generated.
......@@ -71,5 +71,6 @@ public class Messages extends NLS {
public static String severalCompilationErrors;
public static String SelectBusinessDataWizardPageTitle;
public static String selectBusinessDataWizardPageDescription;
public static String contentAssistHint;
}
......@@ -29,16 +29,21 @@ import org.bonitasoft.studio.model.process.ContractConstraint;
import org.bonitasoft.studio.model.process.ContractContainer;
import org.bonitasoft.studio.model.process.ContractInput;
import org.bonitasoft.studio.model.process.ProcessPackage;
import org.bonitasoft.studio.pics.Pics;
import org.bonitasoft.studio.pics.PicsConstants;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.databinding.EMFDataBindingContext;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.jface.databinding.wizard.WizardPageSupport;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.IPropertySource;
......@@ -92,8 +97,13 @@ public class ContractConstraintExpressionWizardPage extends WizardPage implement
public void createControl(final Composite parent) {
final EMFDataBindingContext context = new EMFDataBindingContext();
final Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout());
final GroovyViewer viewer = createSourceViewer(container);
container.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).create());
final Composite editorContainer = new Composite(container, SWT.NONE);
editorContainer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
editorContainer.setLayout(new FillLayout());
final GroovyViewer viewer = createSourceViewer(editorContainer);
getSourceViewer().getTextWidget().setData(ContractInputCompletionProposalComputer.INPUTS, inputs);
getSourceViewer().getDocument().addDocumentListener(this);
......@@ -105,6 +115,11 @@ public class ContractConstraintExpressionWizardPage extends WizardPage implement
context.addValidationStatusProvider(new ConstraintExpressionEditorValidator(expressionContentObservable, inputsObservable, viewer
.getGroovyCompilationUnit(), new MVELProblemRequestor()));
final CLabel contentAssistHint = new CLabel(container, SWT.NONE);
contentAssistHint.setLayoutData(GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).create());
contentAssistHint.setText(Messages.contentAssistHint);
contentAssistHint.setImage(Pics.getImage(PicsConstants.hint));
setControl(container);
WizardPageSupport.create(this, context);
......
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