Java Code Examples for org.eclipse.ui.forms.widgets.FormToolkit

The following are top voted examples for showing how to use org.eclipse.ui.forms.widgets.FormToolkit. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: SimQRI   File: PoissonPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence poissonStep = new BindingCompositionSequence(propertiesEditionComponent);
	poissonStep
		.addStep(MetamodelViewsRepository.Poisson.Properties.class)
		.addStep(MetamodelViewsRepository.Poisson.Properties.interval);
	
	
	composer = new PartComposer(poissonStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Poisson.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Poisson.Properties.interval) {
				return createIntervalText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 2
Project: SimQRI   File: CauchyPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence cauchyStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = cauchyStep.addStep(MetamodelViewsRepository.Cauchy.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Cauchy.Properties.location);
	propertiesStep.addStep(MetamodelViewsRepository.Cauchy.Properties.scale);
	
	
	composer = new PartComposer(cauchyStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Cauchy.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Cauchy.Properties.location) {
				return createLocationText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Cauchy.Properties.scale) {
				return createScaleText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 3
Project: SimQRI   File: StudentsTPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence studentsTStep = new BindingCompositionSequence(propertiesEditionComponent);
	studentsTStep
		.addStep(MetamodelViewsRepository.StudentsT.Properties.class)
		.addStep(MetamodelViewsRepository.StudentsT.Properties.degreeOfFreedom);
	
	
	composer = new PartComposer(studentsTStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.StudentsT.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.StudentsT.Properties.degreeOfFreedom) {
				return createDegreeOfFreedomText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 4
Project: SimQRI   File: WeibullPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence weibullStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = weibullStep.addStep(MetamodelViewsRepository.Weibull.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Weibull.Properties.shape);
	propertiesStep.addStep(MetamodelViewsRepository.Weibull.Properties.scale);
	
	
	composer = new PartComposer(weibullStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Weibull.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Weibull.Properties.shape) {
				return createShapeText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Weibull.Properties.scale) {
				return createScaleText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 5
Project: SimQRI   File: ChiSquarePropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence chiSquareStep = new BindingCompositionSequence(propertiesEditionComponent);
	chiSquareStep
		.addStep(MetamodelViewsRepository.ChiSquare.Properties.class)
		.addStep(MetamodelViewsRepository.ChiSquare.Properties.degreeOfFreedom);
	
	
	composer = new PartComposer(chiSquareStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.ChiSquare.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.ChiSquare.Properties.degreeOfFreedom) {
				return createDegreeOfFreedomText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 6
Project: avro-schema-editor   File: BooleanAttributeControl.java   View source code 6 votes vote down vote up
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<Boolean> element, AvroContext context) {
	
	initialize(element, context);
	
	button = toolkit.createButton(parent, "", SWT.CHECK);	
	
	update();
	
	button.addSelectionListener(new SelectionAdapter() {			
		@Override
		public void widgetSelected(SelectionEvent e) {
			changeAttribute(getAttribute().getValue(), button.getSelection());
		}
	});
	
}
 
Example 7
Project: SimQRI   File: BinomialPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence binomialStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = binomialStep.addStep(MetamodelViewsRepository.Binomial.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Binomial.Properties.nbrOfTrial);
	propertiesStep.addStep(MetamodelViewsRepository.Binomial.Properties.probaOfSuccess);
	
	
	composer = new PartComposer(binomialStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Binomial.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Binomial.Properties.nbrOfTrial) {
				return createNbrOfTrialText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Binomial.Properties.probaOfSuccess) {
				return createProbaOfSuccessText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 8
Project: eZooKeeper   File: JmxConnectionModelMainFormPage.java   View source code 6 votes vote down vote up
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {
    final ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();

    _EditSection = createEditSection(form, client, toolkit);
    GridData editSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _EditSection.setLayoutData(editSectionGridData);

    _PropertiesSection = createPropertiesTableSection(form, client, toolkit);
    GridData propertiesSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _PropertiesSection.setLayoutData(propertiesSectionGridData);

    Table propertiesSectionTable = getPropertiesSectionTable();
    initTableEdit(propertiesSectionTable, null, 1);
}
 
Example 9
Project: eZooKeeper   File: ZnodeModelTextDataEditor.java   View source code 6 votes vote down vote up
@Override
protected void createContent() {

    FormToolkit toolkit = getToolkit();

    _Text = toolkit.createText(this, "", SWT.BORDER | SWT.SINGLE);
    _Text.setFont(JFaceResources.getTextFont());

    FormData formData = new FormData();
    formData.top = new FormAttachment(0, 0);
    formData.left = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);

    _Text.setLayoutData(formData);

    _Text.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            setDirtyInternal(true);
        }
    });

}
 
Example 10
Project: SimQRI   File: ConveyorBeltPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 * 
 */
protected Composite createOutputSingleCompositionEditor(Composite parent, FormToolkit widgetFactory) {
	createDescription(parent, MetamodelViewsRepository.ConveyorBelt.Properties.output, MetamodelMessages.ConveyorBeltPropertiesEditionPart_OutputLabel);
	//create widget
	output = new SingleCompositionEditor(widgetFactory, parent, SWT.NONE);
	GridData outputData = new GridData(GridData.FILL_HORIZONTAL);
	output.setLayoutData(outputData);
	output.addEditorListener(new SingleCompositionListener() {
		
		public void edit() {
			propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConveyorBeltPropertiesEditionPartForm.this,  MetamodelViewsRepository.ConveyorBelt.Properties.output, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, null));				
			output.refresh();
		}
		
		public void clear() {
			propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConveyorBeltPropertiesEditionPartForm.this,  MetamodelViewsRepository.ConveyorBelt.Properties.output, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.UNSET, null, null));
			output.refresh();
		}
	});
	output.setID(MetamodelViewsRepository.ConveyorBelt.Properties.output);
	FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(MetamodelViewsRepository.ConveyorBelt.Properties.output, MetamodelViewsRepository.FORM_KIND), null); //$NON-NLS-1$
	// Start of user code for createOutputSingleCompositionEditor

	// End of user code
	return parent;
}
 
Example 11
Project: SimQRI   File: GeometricPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence geometricStep = new BindingCompositionSequence(propertiesEditionComponent);
	geometricStep
		.addStep(MetamodelViewsRepository.Geometric.Properties.class)
		.addStep(MetamodelViewsRepository.Geometric.Properties.probaOfSuccess);
	
	
	composer = new PartComposer(geometricStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Geometric.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Geometric.Properties.probaOfSuccess) {
				return createProbaOfSuccessText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 12
Project: bdf2   File: DeploymentPage.java   View source code 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm managedForm) {
	FormToolkit toolkit=managedForm.getToolkit();
	ScrolledForm form=managedForm.getForm();
	form.setText("流程模版导出与部署");
	ColumnLayout layout=new ColumnLayout();
	layout.topMargin=0;
	layout.bottomMargin=0;
	layout.leftMargin=0;
	layout.rightMargin=0;
	layout.maxNumColumns=1;
	layout.horizontalSpacing=5;
	layout.verticalSpacing=5;
	form.getBody().setLayout(layout);
	this.createExportSection(toolkit, form);
	this.createOnlineDeploymentSection(toolkit, form);
}
 
Example 13
Project: SimQRI   File: GaussianPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence gaussianStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = gaussianStep.addStep(MetamodelViewsRepository.Gaussian.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Gaussian.Properties.location);
	propertiesStep.addStep(MetamodelViewsRepository.Gaussian.Properties.scale);
	
	
	composer = new PartComposer(gaussianStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Gaussian.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Gaussian.Properties.location) {
				return createLocationText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Gaussian.Properties.scale) {
				return createScaleText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 14
Project: SimQRI   File: BetaPropertiesEditionPartForm.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence betaStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = betaStep.addStep(MetamodelViewsRepository.Beta.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Beta.Properties.freedomDegreeA);
	propertiesStep.addStep(MetamodelViewsRepository.Beta.Properties.freedomDegreeB);
	
	
	composer = new PartComposer(betaStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Beta.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Beta.Properties.freedomDegreeA) {
				return createFreedomDegreeAText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Beta.Properties.freedomDegreeB) {
				return createFreedomDegreeBText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 15
Project: eZooKeeper   File: DataModelFormPage.java   View source code 6 votes vote down vote up
protected Section createTableSection(ScrolledForm form, Composite client, FormToolkit toolkit, String title,
        Image image, int sectionStyle, int tableStyle, String[] columnTitles, int[] columnAlignments) {

    Section section = createSection(form, client, toolkit, title, image, sectionStyle);
    Table table = toolkit.createTable(section, tableStyle);

    for (int i = 0; i < columnTitles.length; i++) {
        TableColumn column = new TableColumn(table, SWT.NONE);
        column.setText(columnTitles[i]);
        column.setAlignment(columnAlignments[i]);
    }

    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    section.setClient(table);

    return section;
}
 
Example 16
Project: SimQRI   File: PoissonPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 17
Project: SimQRI   File: PoissonPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.PoissonPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 18
Project: SimQRI   File: CauchyPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 19
Project: time4sys   File: GeneralPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
protected Composite createIsSerialCheckbox(FormToolkit widgetFactory, Composite parent) {
	isSerial = widgetFactory.createButton(parent, getDescription(HrmViewsRepository.General.Properties.isSerial,
			HrmMessages.GeneralPropertiesEditionPart_IsSerialLabel), SWT.CHECK);
	isSerial.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartForm.this,
								HrmViewsRepository.General.Properties.isSerial, PropertiesEditionEvent.COMMIT,
								PropertiesEditionEvent.SET, null, new Boolean(isSerial.getSelection())));
		}

	});
	GridData isSerialData = new GridData(GridData.FILL_HORIZONTAL);
	isSerialData.horizontalSpan = 2;
	isSerial.setLayoutData(isSerialData);
	EditingUtils.setID(isSerial, HrmViewsRepository.General.Properties.isSerial);
	EditingUtils.setEEFtype(isSerial, "eef::Checkbox"); //$NON-NLS-1$
	FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent
			.getHelpContent(HrmViewsRepository.General.Properties.isSerial, HrmViewsRepository.FORM_KIND), null); // $NON-NLS-1$
	// Start of user code for createIsSerialCheckbox

	// End of user code
	return parent;
}
 
Example 20
Project: time4sys   File: CommunicationPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * @generated
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 21
Project: SimQRI   File: SupplierPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence supplierStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = supplierStep.addStep(MetamodelViewsRepository.Supplier.Properties.class);
	propertiesStep.addStep(MetamodelViewsRepository.Supplier.Properties.name);
	propertiesStep.addStep(MetamodelViewsRepository.Supplier.Properties.deliveredPercentage);
	propertiesStep.addStep(MetamodelViewsRepository.Supplier.Properties.refillPolicy);
	propertiesStep.addStep(MetamodelViewsRepository.Supplier.Properties.supplierDelay);
	
	
	composer = new PartComposer(supplierStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Supplier.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Supplier.Properties.name) {
				return createNameText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Supplier.Properties.deliveredPercentage) {
				return createDeliveredPercentageText(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Supplier.Properties.refillPolicy) {
				return createRefillPolicyReferencesTable(widgetFactory, parent);
			}
			if (key == MetamodelViewsRepository.Supplier.Properties.supplierDelay) {
				return createSupplierDelaySingleCompositionEditor(parent, widgetFactory);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 22
Project: SimQRI   File: SupplierPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.SupplierPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 23
Project: time4sys   File: DesignModelPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * @generated
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 24
Project: time4sys   File: SchedulerPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * @generated
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 25
Project: SimQRI   File: StudentsTPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.StudentsTPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 26
Project: time4sys   File: EventModelPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * @generated
 */

protected Composite createIsSporadicCheckbox(FormToolkit widgetFactory, Composite parent) {
	isSporadic = widgetFactory.createButton(parent, getDescription(AnalysisViewsRepository.EventModel.Properties.isSporadic, AnalysisMessages.EventModelPropertiesEditionPart_IsSporadicLabel), SWT.CHECK);
	isSporadic.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 	@generated
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(EventModelPropertiesEditionPartForm.this, AnalysisViewsRepository.EventModel.Properties.isSporadic, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(isSporadic.getSelection())));
		}

	});
	GridData isSporadicData = new GridData(GridData.FILL_HORIZONTAL);
	isSporadicData.horizontalSpan = 2;
	isSporadic.setLayoutData(isSporadicData);
	EditingUtils.setID(isSporadic, AnalysisViewsRepository.EventModel.Properties.isSporadic);
	EditingUtils.setEEFtype(isSporadic, "eef::Checkbox"); //$NON-NLS-1$
	FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(AnalysisViewsRepository.EventModel.Properties.isSporadic, AnalysisViewsRepository.FORM_KIND), null); //$NON-NLS-1$
	// Start of user code for createIsSporadicCheckbox

	// End of user code
	return parent;
}
 
Example 27
Project: time4sys   File: GeneralPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 28
Project: SimQRI   File: LogNormalPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.LogNormalPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 29
Project: SimQRI   File: WeibullPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 30
Project: time4sys   File: GeneralPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
protected Composite createMinOpenCheckbox(FormToolkit widgetFactory, Composite parent) {
	minOpen = widgetFactory.createButton(parent, getDescription(NfpViewsRepository.General.Properties.minOpen, NfpMessages.GeneralPropertiesEditionPart_MinOpenLabel), SWT.CHECK);
	minOpen.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 	
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartForm.this, NfpViewsRepository.General.Properties.minOpen, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(minOpen.getSelection())));
		}

	});
	GridData minOpenData = new GridData(GridData.FILL_HORIZONTAL);
	minOpenData.horizontalSpan = 2;
	minOpen.setLayoutData(minOpenData);
	EditingUtils.setID(minOpen, NfpViewsRepository.General.Properties.minOpen);
	EditingUtils.setEEFtype(minOpen, "eef::Checkbox"); //$NON-NLS-1$
	FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(NfpViewsRepository.General.Properties.minOpen, NfpViewsRepository.FORM_KIND), null); //$NON-NLS-1$
	// Start of user code for createMinOpenCheckbox

	// End of user code
	return parent;
}
 
Example 31
Project: time4sys   File: InputPortPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * @generated
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(AnalysisMessages.InputPortPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 32
Project: eZooKeeper   File: BaseZnodeModelFormPage.java   View source code 5 votes vote down vote up
@Override
protected void contributeToToolBar(IToolBarManager toolBarManager) {
    super.contributeToToolBar(toolBarManager);

    ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) {

        @Override
        protected Control createControl(Composite parent) {

            FormToolkit toolkit = getManagedForm().getToolkit();
            Composite toolBarComposite = toolkit.createComposite(parent);
            FormLayout toolBarCompositeLayout = new FormLayout();
            toolBarCompositeLayout.marginTop = 0;
            toolBarCompositeLayout.marginBottom = 0;
            toolBarCompositeLayout.marginLeft = 4;
            toolBarCompositeLayout.marginRight = 4;
            toolBarCompositeLayout.spacing = 4;
            toolBarComposite.setLayout(toolBarCompositeLayout);

            _ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT);

            FormData toolBarLabelFormData = new FormData();
            toolBarLabelFormData.top = new FormAttachment(0, 0);
            toolBarLabelFormData.left = new FormAttachment(0, 0);
            toolBarLabelFormData.right = new FormAttachment(100, 0);

            // HACK: I really struggled to get this label to show up.
            toolBarLabelFormData.width = 100;

            _ToolBarLabel.setLayoutData(toolBarLabelFormData);

            return toolBarComposite;
        }
    };

    toolBarManager.add(toolBarCompositeContribution);

}
 
Example 33
Project: time4sys   File: ConstraintContainerPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * @generated
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 34
Project: time4sys   File: MemoryResourcePropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * @generated
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(AnalysisMessages.MemoryResourcePropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 35
Project: time4sys   File: GeneralPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *      createFigure(org.eclipse.swt.widgets.Composite,
 *      org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 36
Project: SimQRI   File: ChiSquarePropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 37
Project: time4sys   File: SchedulerParameterValuePropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
 * @generated
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence schedulerParameterValueStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = schedulerParameterValueStep.addStep(AnalysisViewsRepository.SchedulerParameterValue.Properties.class);
	propertiesStep.addStep(AnalysisViewsRepository.SchedulerParameterValue.Properties.type);
	propertiesStep.addStep(AnalysisViewsRepository.SchedulerParameterValue.Properties.value);
	propertiesStep.addStep(AnalysisViewsRepository.SchedulerParameterValue.Properties.parent_);
	
	
	composer = new PartComposer(schedulerParameterValueStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == AnalysisViewsRepository.SchedulerParameterValue.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == AnalysisViewsRepository.SchedulerParameterValue.Properties.type) {
				return createTypeFlatComboViewer(parent, widgetFactory);
			}
			if (key == AnalysisViewsRepository.SchedulerParameterValue.Properties.value) {
				return createValueText(widgetFactory, parent);
			}
			if (key == AnalysisViewsRepository.SchedulerParameterValue.Properties.parent_) {
				return createParent_FlatComboViewer(parent, widgetFactory);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 38
Project: SimQRI   File: StoragePropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}
 
Example 39
Project: SimQRI   File: StoragePropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.StoragePropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
Example 40
Project: time4sys   File: TimingPropertiesEditionPartForm.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
 *  createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
 * 
 */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
	ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
	Form form = scrolledForm.getForm();
	view = form.getBody();
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(widgetFactory, view);
	return scrolledForm;
}