org.eclipse.ui.forms.widgets.Form Java Examples

The following examples show how to use org.eclipse.ui.forms.widgets.Form. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecipientListRouterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #2
Source File: TextContainer.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public Composite createContainer(final Composite parent, final ITextPlugin.ICallback h){
	parent.setLayout(new FillLayout());
	// Composite ret=new Composite(parent,SWT.BORDER);
	Form form = UiDesk.getToolkit().createForm(parent);
	form.setText(Messages.TextContainer_NoPluginCaption);
	form.getBody().setLayout(new FillLayout());
	FormText ft = UiDesk.getToolkit().createFormText(form.getBody(), false);
	ft.setText(expl, true, false);
	return form.getBody();
}
 
Example #3
Source File: TextTemplateView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void createTextPluginMissingForm(Composite parent){
	String expl =
		Messages.TextTemplateVeiw_NoTxtPluginDescription
			+ Messages.TextTemplateVeiw_NoTxtPluginReason1
			+ Messages.TextTemplateVeiw_NoTxtPluginReason2
			+ Messages.TextTemplateVeiw_NoTxtPluginReason3;
	
	Form form = UiDesk.getToolkit().createForm(parent);
	form.setText(Messages.TextTemplateVeiw_NoTxtPluginTitel);
	form.setLayoutData(SWTHelper.fillGrid(parent, 1));
	form.getBody().setLayout(new GridLayout(1, false));
	FormText ft = UiDesk.getToolkit().createFormText(form.getBody(), false);
	ft.setText(expl, true, false);
}
 
Example #4
Source File: TogglePropertyHelpContributionItem.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public TogglePropertyHelpContributionItem(final FormToolkit toolkit,
        final Form form, 
        final String helpContent,
        int wellSeverity,
        final PropertySectionHistory propertySectionHistory) {
    this.helpContent = helpContent;
    this.wellSeverity = wellSeverity;
    this.form = form;
    this.toolkit = toolkit;
    this.propertySectionHistory = propertySectionHistory;
}
 
Example #5
Source File: AbstractFormPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private Control createHeader(Form form) {
    final Composite head = form.getHead();
    final ToolBar toolBar = new ToolBar(head, SWT.HORIZONTAL | SWT.RIGHT | SWT.NO_FOCUS);
    toolBarManager = new ToolBarManager(toolBar);
    createHeaderContent(toolBar);

    Label toolbarSeparator = new Label(form.getBody(), SWT.HORIZONTAL | SWT.SEPARATOR);
    toolbarSeparator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    return toolBar;
}
 
Example #6
Source File: TransformerPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #7
Source File: ServiceRefPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #8
Source File: EIPModelPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #9
Source File: AggregatorPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #10
Source File: GatewayPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #11
Source File: AdapterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #12
Source File: ConditionalRoutePropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #13
Source File: InvocableEndpointPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #14
Source File: ResequencerPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #15
Source File: RouterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #16
Source File: CompositeProcessorPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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
Source File: FilterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #18
Source File: ServiceActivatorPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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
Source File: ServiceInvocationPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #20
Source File: SplitterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #21
Source File: ChannelPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #22
Source File: EnricherPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #23
Source File: ContentFilterPropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #24
Source File: RoutePropertiesEditionPartForm.java    From eip-designer with Apache License 2.0 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 #25
Source File: InvoiceListBottomComposite.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create the composite.
 * 
 * @wbp.eval.method.parameter rnStellerSettings new ch.rgw.io.InMemorySettings()
 * @param parent
 * @param style
 */
public InvoiceListBottomComposite(Composite parent, int style, Settings rnStellerSettings){
	super(parent, style);
	this.rnStellerSettings = rnStellerSettings;
	
	mahnWizardListener = new SelectionAdapter() {
		@Override
		public void widgetSelected(final SelectionEvent e){
			rnStellerSettings.set(Preferences.RNN_DAYSUNTIL1ST, niDaysTo1st.getValue());
			rnStellerSettings.set(Preferences.RNN_DAYSUNTIL2ND, niDaysTo2nd.getValue());
			rnStellerSettings.set(Preferences.RNN_DAYSUNTIL3RD, niDaysTo3rd.getValue());
			rnStellerSettings.set(Preferences.RNN_AMOUNT1ST, mi1st.getMoney(false)
				.getAmountAsString());
			rnStellerSettings.set(Preferences.RNN_AMOUNT2ND, mi2nd.getMoney(false)
				.getAmountAsString());
			rnStellerSettings.set(Preferences.RNN_AMOUNT3RD, mi3rd.getMoney(false)
				.getAmountAsString());
			rnStellerSettings.flush();
		}
	};
	
	RowLayout rowLayout = new RowLayout();
	rowLayout.wrap = false;
	rowLayout.pack = true;
	rowLayout.justify = true;
	rowLayout.fill = true;
	rowLayout.type = SWT.HORIZONTAL;
	rowLayout.marginLeft = 0;
	rowLayout.marginTop = 0;
	rowLayout.marginRight = 0;
	rowLayout.marginBottom = 0;
	rowLayout.spacing = 5;
	
	setLayout(rowLayout);
	Form fSum = tk.createForm(this);
	Form fWizard = tk.createForm(this);
	fSum.setText(Messages.RechnungsListeView_sum); //$NON-NLS-1$
	fWizard.setText(Messages.RechnungsListeView_dunningAutomatics); //$NON-NLS-1$
	Composite cSum = fSum.getBody();
	cSum.setLayout(new GridLayout(2, false));
	tk.createLabel(cSum, Messages.RechnungsListeView_patInList); //$NON-NLS-1$
	 totalPatientsInListText = tk.createText(cSum, "", SWT.BORDER | SWT.READ_ONLY); //$NON-NLS-1$
	totalPatientsInListText.setLayoutData(new GridData(100, SWT.DEFAULT));
	tk.createLabel(cSum, Messages.RechnungsListeView_accountsInList); //$NON-NLS-1$
	tSumInvoiceInList = tk.createText(cSum, "", SWT.BORDER | SWT.READ_ONLY); //$NON-NLS-1$
	tSumInvoiceInList.setLayoutData(new GridData(100, SWT.DEFAULT));
	tk.createLabel(cSum, Messages.RechnungsListeView_sumInList); //$NON-NLS-1$
	tSum = SWTHelper.createText(tk, cSum, 1, SWT.BORDER | SWT.READ_ONLY);
	tSum.setLayoutData(new GridData(100, SWT.DEFAULT));
	tk.createLabel(cSum, Messages.RechnungsListeView_paidInList); //$NON-NLS-1$
	tOpen = SWTHelper.createText(tk, cSum, 1, SWT.BORDER | SWT.READ_ONLY);
	tOpen.setLayoutData(new GridData(100, SWT.DEFAULT));
	Composite cW = fWizard.getBody();
	cW.setLayout(new GridLayout(4, true));
	
	tk.createLabel(cW, Messages.RechnungsListeView_delayInDays); //$NON-NLS-1$
	
	niDaysTo1st = new NumberInput(cW, REMINDER_1);
	niDaysTo1st.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	niDaysTo1st.getControl().addSelectionListener(mahnWizardListener);
	niDaysTo1st.setValue(rnStellerSettings.get(Preferences.RNN_DAYSUNTIL1ST, 30));
	niDaysTo2nd = new NumberInput(cW, REMINDER_2);
	niDaysTo2nd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	niDaysTo2nd.getControl().addSelectionListener(mahnWizardListener);
	niDaysTo2nd.setValue(rnStellerSettings.get(Preferences.RNN_DAYSUNTIL2ND, 10));
	niDaysTo3rd = new NumberInput(cW, REMINDER_3);
	niDaysTo3rd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	niDaysTo3rd.getControl().addSelectionListener(mahnWizardListener);
	niDaysTo3rd.setValue(rnStellerSettings.get(Preferences.RNN_DAYSUNTIL3RD, 5));
	tk.createLabel(cW, Messages.RechnungsListeView_fine); //$NON-NLS-1$
	mi1st = new MoneyInput(cW, REMINDER_1);
	mi1st.addSelectionListener(mahnWizardListener);
	mi1st.setMoney(
		rnStellerSettings.get(Preferences.RNN_AMOUNT1ST, new Money().getAmountAsString()));
	mi2nd = new MoneyInput(cW, REMINDER_2);
	mi2nd.addSelectionListener(mahnWizardListener);
	mi2nd.setMoney(
		rnStellerSettings.get(Preferences.RNN_AMOUNT2ND, new Money().getAmountAsString()));
	mi3rd = new MoneyInput(cW, REMINDER_3);
	mi3rd.addSelectionListener(mahnWizardListener);
	mi3rd.setMoney(
		rnStellerSettings.get(Preferences.RNN_AMOUNT3RD, new Money().getAmountAsString()));
}
 
Example #26
Source File: DBImportFirstPage.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
public void createControl(Composite parent){
	DBImportWizard wiz = (DBImportWizard) getWizard();
	
	FormToolkit tk = UiDesk.getToolkit();
	Form form = tk.createForm(parent);
	form.setText(Messages.DBImportFirstPage_Connection); //$NON-NLS-1$
	Composite body = form.getBody();
	body.setLayout(new TableWrapLayout());
	tk.createLabel(body, Messages.DBImportFirstPage_EnterType); //$NON-NLS-1$
	dbTypes = new List(body, SWT.BORDER);
	dbTypes.setItems(supportedDB);
	dbTypes.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e){
			int it = dbTypes.getSelectionIndex();
			switch (it) {
			case MYSQL:
			case POSTGRESQL:
				server.setEnabled(true);
				dbName.setEnabled(true);
				defaultUser = ""; //$NON-NLS-1$
				defaultPassword = ""; //$NON-NLS-1$
				break;
			case H2:
				server.setEnabled(false);
				dbName.setEnabled(true);
				defaultUser = "sa";
				defaultPassword = "";
				break;
			case ODBC:
				server.setEnabled(false);
				dbName.setEnabled(true);
				defaultUser = "sa"; //$NON-NLS-1$
				defaultPassword = ""; //$NON-NLS-1$
				break;
			default:
				break;
			}
			DBImportSecondPage sec = (DBImportSecondPage) getNextPage();
			sec.name.setText(defaultUser);
			sec.pwd.setText(defaultPassword);
			
		}
		
	});
	
	tk.adapt(dbTypes, true, true);
	tk.createLabel(body, Messages.DBImportFirstPage_serverAddress); //$NON-NLS-1$
	server = tk.createText(body, "", SWT.BORDER); //$NON-NLS-1$
	
	TableWrapData twr = new TableWrapData(TableWrapData.FILL_GRAB);
	server.setLayoutData(twr);
	tk.createLabel(body, Messages.DBImportFirstPage_databaseName); //$NON-NLS-1$
	dbName = tk.createText(body, "", SWT.BORDER); //$NON-NLS-1$
	TableWrapData twr2 = new TableWrapData(TableWrapData.FILL_GRAB);
	dbName.setLayoutData(twr2);
	if (wiz.preset != null && wiz.preset.length > 1) {
		int idx = StringTool.getIndex(supportedDB, wiz.preset[0]);
		if (idx < dbTypes.getItemCount()) {
			dbTypes.select(idx);
		}
		server.setText(wiz.preset[1]);
		dbName.setText(wiz.preset[2]);
	}
	setControl(form);
}
 
Example #27
Source File: DBConnectFirstPage.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
public void createControl(Composite parent){
	FormToolkit tk = UiDesk.getToolkit();
	Form form = tk.createForm(parent);
	form.setText(Messages.DBConnectFirstPage_connectioNDetails); //$NON-NLS-1$
	Composite body = form.getBody();
	body.setLayout(new TableWrapLayout());
	FormText alt = tk.createFormText(body, false);
	StringBuilder old = new StringBuilder();
	old.append("<form>"); //$NON-NLS-1$
	String driver = "";
	String user = "";
	String typ = "";
	String connectString = "";
	Hashtable<Object, Object> hConn = null;
	String cnt = CoreHub.localCfg.get(Preferences.CFG_FOLDED_CONNECTION, null);
	if (cnt != null) {
		hConn = PersistentObject.fold(StringTool.dePrintable(cnt));
		if (hConn != null) {
			driver =
				PersistentObject.checkNull(hConn.get(Preferences.CFG_FOLDED_CONNECTION_DRIVER));
			connectString =
				PersistentObject.checkNull(hConn
					.get(Preferences.CFG_FOLDED_CONNECTION_CONNECTSTRING));
			user =
				PersistentObject.checkNull(hConn.get(Preferences.CFG_FOLDED_CONNECTION_USER));
			typ = PersistentObject.checkNull(hConn.get(Preferences.CFG_FOLDED_CONNECTION_TYPE));
		}
	}
	// Check whether we were overridden
	String dbUser = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_USERNAME);
	String dbPw = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_PASSWORD);
	String dbFlavor = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_FLAVOR);
	String dbSpec = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_SPEC);
	if (dbUser != null && dbPw != null && dbFlavor != null && dbSpec != null) {
		old.append("<br/><li><b>Aktuelle Verbindung wurde via Übergabeparameter ans Programm gesetzt!</b></li><br/>"); //$NON-NLS-1$
	}
	if (ch.rgw.tools.StringTool.isNothing(connectString)) {
		old.append("<br/>"); //$NON-NLS-1$
		old.append("Keine konfigurierte Verbindung."); //$NON-NLS-1$
	} else {
		old.append("Konfigurierte Verbindung ist:<br/>"); //$NON-NLS-1$
		old.append("<li><b>Typ:</b>       ").append(typ).append("</li>"); //$NON-NLS-1$ //$NON-NLS-2$
		old.append("<li><b>Treiber</b>    ").append(driver).append("</li>"); //$NON-NLS-1$ //$NON-NLS-2$
		old.append("<li><b>Verbinde</b>   ").append(connectString).append("</li>"); //$NON-NLS-1$ //$NON-NLS-2$
		old.append("<li><b>Username</b>   ").append(user).append("</li>"); //$NON-NLS-1$ //$NON-NLS-2$
	}
	if (PersistentObject.getConnection() != null
		&& PersistentObject.getConnection().getConnectString() != null) {
		old.append("<li><b>Effektiv</b> verwendet wird:").append( //$NON-NLS-1$
			PersistentObject.getConnection().getConnectString()).append("</li>"); //$NON-NLS-1$
	}
	old.append("</form>"); //$NON-NLS-1$
	alt.setText(old.toString(), true, false);
	// Composite form=new Composite(parent, SWT.BORDER);
	Label sep = tk.createSeparator(body, SWT.NONE);
	TableWrapData twd = new TableWrapData();
	twd.heightHint = 5;
	sep.setLayoutData(twd);
	tk.createLabel(body, Messages.DBConnectFirstPage_enterType); //$NON-NLS-1$
	dbTypes = new Combo(body, SWT.BORDER | SWT.SIMPLE);
	dbTypes.setItems(supportedDB);
	dbTypes.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e){
			int it = dbTypes.getSelectionIndex();
			switch (it) {
			case 0:
			case 1:
				server.setEnabled(true);
				dbName.setEnabled(true);
				defaultUser = "elexis"; //$NON-NLS-1$
				defaultPassword = "elexisTest"; //$NON-NLS-1$
				break;
			case 2:
				server.setEnabled(false);
				dbName.setEnabled(true);
				defaultUser = "sa"; //$NON-NLS-1$
				defaultPassword = ""; //$NON-NLS-1$
				break;
			default:
				break;
			}
			DBConnectSecondPage sec = (DBConnectSecondPage) getNextPage();
			sec.name.setText(defaultUser);
			sec.pwd.setText(defaultPassword);
			
		}
		
	});
	tk.adapt(dbTypes, true, true);
	tk.createLabel(body, Messages.DBConnectFirstPage_serevrAddress); //$NON-NLS-1$
	server = tk.createText(body, "", SWT.BORDER); //$NON-NLS-1$
	TableWrapData twr = new TableWrapData(TableWrapData.FILL_GRAB);
	server.setLayoutData(twr);
	tk.createLabel(body, Messages.DBConnectFirstPage_databaseName); //$NON-NLS-1$
	dbName = tk.createText(body, "", SWT.BORDER); //$NON-NLS-1$
	TableWrapData twr2 = new TableWrapData(TableWrapData.FILL_GRAB);
	dbName.setLayoutData(twr2);
	setControl(form);
}