Java Code Examples for org.eclipse.swt.widgets.Composite

The following are top voted examples for showing how to use org.eclipse.swt.widgets.Composite. 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: n4js   File: CustomElementSelectionForm.java   View source code 6 votes vote down vote up
/**
 * Create the composite.
 */
public CustomElementSelectionForm(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(2, false));

	treeViewer = new TreeViewer(this, SWT.BORDER);
	Tree tree = getTreeViewer().getTree();

	// Set a minimum height to prevent weird dialog dimensions
	tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());

	elementLabel = new Label(this, SWT.NONE);
	elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
	elementLabel.setText("New Label");

	elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
	elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
 
Example 2
Project: gw4e.project   File: GW4ELaunchConfigurationTab.java   View source code 6 votes vote down vote up
/**
 * Create the element that allow to select a project See the GraphWalker
 * offline command for more information
 */
private void createProjectSection(Composite parent) {
	fProjLabel = new Label(parent, SWT.NONE);
	fProjLabel.setText(MessageUtil.getString("label_project"));
	GridData gd = new GridData();
	gd.horizontalIndent = 25;
	fProjLabel.setLayoutData(gd);

	fProjText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	fProjText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	fProjText.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent evt) {
			validatePage();
			updateConfigState();

		}
	});
	fProjText.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID, GW4E_LAUNCH_CONFIGURATION_TEXT_ID_PROJECT);

}
 
Example 3
Project: BiglyBT   File: DHTOpsView.java   View source code 6 votes vote down vote up
public void initialize(Composite composite) {
	if ( autoDHT ){
		CoreFactory.addCoreRunningListener(new CoreRunningListener() {

			@Override
			public void coreRunning(Core core) {
				DHTOpsView.this.core = core;
				init(core);
			}
		});
	}

	panel = new Composite(composite,SWT.NULL);
	panel.setLayout(new FillLayout());
	drawPanel = new DHTOpsPanel(panel);
	drawPanel.setAutoAlpha(autoAlpha);
}
 
Example 4
Project: time4sys   File: DesignModelPropertiesEditionPartForm.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)
 * @generated
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence designModelStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = designModelStep.addStep(DesignViewsRepository.DesignModel.Properties.class);
	propertiesStep.addStep(DesignViewsRepository.DesignModel.Properties.endToEndFlows);
	propertiesStep.addStep(DesignViewsRepository.DesignModel.Properties.name);
	
	
	composer = new PartComposer(designModelStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == DesignViewsRepository.DesignModel.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == DesignViewsRepository.DesignModel.Properties.endToEndFlows) {
				return createEndToEndFlowsTableComposition(widgetFactory, parent);
			}
			if (key == DesignViewsRepository.DesignModel.Properties.name) {
				return createNameText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 5
Project: Hydrograph   File: ExcelFormattingDialog.java   View source code 6 votes vote down vote up
/**
 * Create contents of the dialog.
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	container.getShell().setText(this.windowLabel);
	
	Composite main_composite = new Composite(container, SWT.NONE);
	main_composite.setLayout(new GridLayout(1, false));
	main_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	createTopComposite(main_composite);

	createTableComposite(main_composite);

	populateWidget();

	return container;
}
 
Example 6
Project: BiglyBT   File: IntListParameter.java   View source code 6 votes vote down vote up
public IntListParameter(Composite composite, final String name,
	int defaultValue, final String labels[], final int values[]) {
super(name);
this.name = name;
this.values = values;

    if(labels.length != values.length)
      return;
    int value = COConfigurationManager.getIntParameter(name,defaultValue);
    int index = findIndex(value,values);
    list = new Combo(composite,SWT.SINGLE | SWT.READ_ONLY);
    for(int i = 0 ; i < labels.length  ;i++) {
      list.add(labels[i]);
    }

    setIndex(index);

    list.addListener(SWT.Selection, new Listener() {
         @Override
         public void handleEvent(Event e) {
        	 setIndex(list.getSelectionIndex());
         }
       });

  }
 
Example 7
Project: time4sys   File: ResourceSchedulingParameterValuePropertiesEditionPartForm.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)
 * @generated
 */
public void createControls(final FormToolkit widgetFactory, Composite view) {
	CompositionSequence resourceSchedulingParameterValueStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = resourceSchedulingParameterValueStep.addStep(AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.class);
	propertiesStep.addStep(AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.name);
	propertiesStep.addStep(AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.value);
	
	
	composer = new PartComposer(resourceSchedulingParameterValueStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.class) {
				return createPropertiesGroup(widgetFactory, parent);
			}
			if (key == AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.name) {
				return createNameText(widgetFactory, parent);
			}
			if (key == AnalysisViewsRepository.ResourceSchedulingParameterValue.Properties.value) {
				return createValueText(widgetFactory, parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 8
Project: pgcodekeeper   File: DbStorePrefPage.java   View source code 6 votes vote down vote up
@Override
protected ListViewer createViewer(Composite parent) {
    ListViewer viewerObjs = new ListViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData gd =  new GridData(SWT.FILL, SWT.FILL, true, true, 1, 5);
    gd.widthHint = PREF_PAGE.WIDTH_HINT_PX;
    viewerObjs.getControl().setLayoutData(gd);

    viewerObjs.setContentProvider(ArrayContentProvider.getInstance());
    viewerObjs.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            return ((DbInfo) element).getName();
        }
    });
    return viewerObjs;
}
 
Example 9
Project: parabuild-ci   File: ChartComposite.java   View source code 6 votes vote down vote up
/**
 * Constructs a panel containing a chart.
 *
 * @param comp The parent.
 * @param style The style of the composite.
 * @param chart  the chart.
 * @param useBuffer  a flag controlling whether or not an off-screen buffer
 *                   is used.
 */
public ChartComposite(Composite comp, int style, JFreeChart chart, 
        boolean useBuffer) {
    
    this(comp, style, chart,
            DEFAULT_WIDTH,
            DEFAULT_HEIGHT,
            DEFAULT_MINIMUM_DRAW_WIDTH,
            DEFAULT_MINIMUM_DRAW_HEIGHT,
            DEFAULT_MAXIMUM_DRAW_WIDTH,
            DEFAULT_MAXIMUM_DRAW_HEIGHT,
            useBuffer,
            true,  // properties
            true,  // save
            true,  // print
            true,  // zoom
            true   // tooltips
            );
}
 
Example 10
Project: SimQRI   File: ScalarPropertiesEditionPartImpl.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createControls(org.eclipse.swt.widgets.Composite)
 * 
 */
public void createControls(Composite view) { 
	CompositionSequence scalarStep = new BindingCompositionSequence(propertiesEditionComponent);
	scalarStep
		.addStep(MetamodelViewsRepository.Scalar.Properties.class)
		.addStep(MetamodelViewsRepository.Scalar.Properties.value);
	
	
	composer = new PartComposer(scalarStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == MetamodelViewsRepository.Scalar.Properties.class) {
				return createPropertiesGroup(parent);
			}
			if (key == MetamodelViewsRepository.Scalar.Properties.value) {
				return createValueText(parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 11
Project: ide-plugins   File: PluginDialog.java   View source code 6 votes vote down vote up
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = new Composite(parent, SWT.NONE);
    buttonBar.setBackground(backColor);
    		
    final GridLayout layout = new GridLayout();
    layout.marginLeft = 10;
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = false;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonBar.setLayout(layout);

    final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = false;
    buttonBar.setLayoutData(data);

    buttonBar.setFont(parent.getFont());

    // add the dialog's button bar to the right
    buttonControl = super.createButtonBar(buttonBar);
    buttonControl.setBackground(backColor);
    buttonControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));

    return buttonBar;
}
 
Example 12
Project: time4sys   File: ResourceProtectionParameterValuePropertiesEditionPartImpl.java   View source code 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createControls(org.eclipse.swt.widgets.Composite)
 * @generated
 */
public void createControls(Composite view) { 
	CompositionSequence resourceProtectionParameterValueStep = new BindingCompositionSequence(propertiesEditionComponent);
	CompositionStep propertiesStep = resourceProtectionParameterValueStep.addStep(AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.class);
	propertiesStep.addStep(AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.name);
	propertiesStep.addStep(AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.value);
	
	
	composer = new PartComposer(resourceProtectionParameterValueStep) {

		@Override
		public Composite addToPart(Composite parent, Object key) {
			if (key == AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.class) {
				return createPropertiesGroup(parent);
			}
			if (key == AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.name) {
				return createNameText(parent);
			}
			if (key == AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.value) {
				return createValueText(parent);
			}
			return parent;
		}
	};
	composer.compose(view);
}
 
Example 13
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 14
Project: time4sys   File: DelayPropertiesEditionPartForm.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 15
Project: Hydrograph   File: ELTSaparater.java   View source code 5 votes vote down vote up
@Override
public void attachWidget(Composite container) {
	// TODO Auto-generated method stub
	label = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
	GridData gd_defaultELTLable = new GridData(SWT.LEFT, SWT.CENTER, grabExcessSpace, false, 1, 1);
	gd_defaultELTLable.widthHint = lableWidth;
	label.setLayoutData(gd_defaultELTLable);	
	label.setVisible(visible);
	
	widget = label;
}
 
Example 16
Project: neoscada   File: ControlImage.java   View source code 5 votes vote down vote up
/**
 * Get the client space and create if it does not yet exists.
 * <p>
 * Note that if the client space is not filled, the default size of the
 * empty composite will be 64x64 due to some strange SWT philosophy.
 * </p>
 * 
 * @return The client space composite
 */
public Composite getClientSpace ()
{
    if ( this.clientSpace == null )
    {
        this.clientSpace = new Composite ( this, SWT.NONE );
        this.clientSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) );
    }
    return this.clientSpace;
}
 
Example 17
Project: pgcodekeeper   File: FeedBackDialog.java   View source code 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(2, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    new Label(container, SWT.NONE).setText(Messages.FeedBackDialog_subject);

    txtSubject = new Text(container, SWT.BORDER);
    txtSubject.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    new Label(container, SWT.NONE).setText(Messages.e_mail);

    emailFrom = new Text(container, SWT.BORDER);
    emailFrom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    new Label(container, SWT.NONE).setText(Messages.feedback_message);

    txtMessage = new Text(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = new PixelConverter(container).convertHeightInCharsToPixels(8);
    txtMessage.setLayoutData(gd);

    new Label(container, SWT.NONE);

    btnCheckLog = new Button(container, SWT.CHECK);
    btnCheckLog.setText(Messages.add_log);

    return container;
}
 
Example 18
Project: n4js   File: CustomElementSelectionDialog.java   View source code 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	CustomElementSelectionForm form = new CustomElementSelectionForm(parent, SWT.FILL);
	form.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

	TreeViewer v = form.getTreeViewer();
	for (ViewerFilter filter : filters) {
		v.addFilter(filter);
	}
	this.treeViewer = v;

	WorkbenchContentProvider contentProvider = new WorkbenchContentProvider();
	ILabelProvider labelProvider = new WorkbenchLabelProvider();

	this.treeViewer.setContentProvider(contentProvider);
	this.treeViewer.setLabelProvider(labelProvider);

	this.treeViewer.setComparator(new ViewerComparator());

	this.treeViewer.setAutoExpandLevel(this.getAutoExpandLevel());

	form.setElementLabel(this.elementLabel);

	this.elementNameInput = form.getElementInput();

	form.getElementInput().addPropertyChangeListener(new PropertyChangeListener() {

		@Override
		public void propertyChange(PropertyChangeEvent evt) {
			if (evt.getPropertyName().equals(SuffixText.TEXT_PROPERTY) ||
					evt.getPropertyName().equals(SuffixText.SUFFIX_PROPERTY)) {
				validateElementInput();
				elementInputChanged();
			}

		}
	});
	return form;
}
 
Example 19
Project: applecommander   File: ExportGraphicsTypePane.java   View source code 5 votes vote down vote up
/**
 * Constructor for ExportGraphicsTypePane.
 */
public ExportGraphicsTypePane(Composite parent, ExportWizard exportWizard, Object layoutData) {
	super();
	this.parent = parent;
	this.wizard = exportWizard;
	this.layoutData = layoutData;
}
 
Example 20
Project: time4sys   File: RequiredProtectionParameterPropertiesEditionPartImpl.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createFigure(org.eclipse.swt.widgets.Composite)
 * @generated
 */
public Composite createFigure(final Composite parent) {
	view = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(view);
	return view;
}
 
Example 21
Project: Hydrograph   File: ExpressionComposite.java   View source code 5 votes vote down vote up
private void createSwitchToOperationButton(Composite switchToCompsite) {
	operationRadioButton = new Button(switchToCompsite, SWT.RADIO);
	operationRadioButton.setText("Operation");
	operationRadioButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			dialog.switchToOperation();
			dialog.getDataStructure().setOperation(true);
			dialog.refreshErrorLogs();
		}
	});
}
 
Example 22
Project: convertigo-eclipse   File: ProjectFileFieldEditor.java   View source code 5 votes vote down vote up
/**
 * Creates a file field editor.
 * 
 * @param name the name of the preference this field editor works on
 * @param labelText the label text of the field editor
 * @param enforceAbsolute <code>true</code> if the file path
 *  must be absolute, and <code>false</code> otherwise
 * @param parent the parent of the field editor's control
 */
public ProjectFileFieldEditor(String name, String labelText,
        boolean enforceAbsolute, Composite parent) {
    init(name, labelText);
    this.enforceAbsolute = enforceAbsolute;
    setErrorMessage(JFaceResources.getString("FileFieldEditor.errorMessage"));//$NON-NLS-1$
    setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$
    setValidateStrategy(VALIDATE_ON_FOCUS_LOST);
    createControl(parent);
}
 
Example 23
Project: time4sys   File: GeneralPropertiesEditionPartImpl.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(Composite parent) {
	Group propertiesGroup = new Group(parent, SWT.NONE);
	propertiesGroup.setText(GqamMessages.GeneralPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesGroupData.horizontalSpan = 3;
	propertiesGroup.setLayoutData(propertiesGroupData);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	return propertiesGroup;
}
 
Example 24
Project: Hydrograph   File: RunConfigDialog.java   View source code 5 votes vote down vote up
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
	okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
	createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
	
	applyServerDetailsCrossTextEmptyValidationListener(txtEdgeNode);
	applyServerDetailsCrossTextEmptyValidationListener(txtPassword);
	applyServerDetailsCrossTextEmptyValidationListener(txtUserName);
	applyServerDetailsCrossTextEmptyValidationListener(txtBasePath);
	applyServerDetailsCrossTextEmptyValidationListener(txtKeyFile);
	applyServerDetailsCrossTextEmptyValidationListener(txtRunUtility);
	applyServerDetailsCrossTextEmptyValidationListener(txtProjectPath);
	loadBuildProperties();
}
 
Example 25
Project: Tarski   File: BoundSelectionPage.java   View source code 5 votes vote down vote up
public static void setEnabledRecursive(final Composite composite, final boolean enabled) {
  Control[] children = composite.getChildren();
  for (int i = 0; i < children.length; i++) {
    if (children[i] instanceof Composite) {
      setEnabledRecursive((Composite) children[i], enabled);
    } else {
      children[i].setEnabled(enabled);
    }
  }
  composite.setEnabled(enabled);
}
 
Example 26
Project: SimQRI   File: DiracDeltaPropertiesEditionPartForm.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.DiracDeltaPropertiesEditionPart_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 27
Project: time4sys   File: ConstraintContainerPropertiesEditionPartImpl.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createFigure(org.eclipse.swt.widgets.Composite)
 * @generated
 */
public Composite createFigure(final Composite parent) {
	view = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(view);
	return view;
}
 
Example 28
Project: convertigo-eclipse   File: SqlQueryEditorComposite.java   View source code 5 votes vote down vote up
public SqlQueryEditorComposite(Composite parent, int style, AbstractDialogCellEditor cellEditor) {
	super(parent, style, cellEditor);
	initialize();
	
	String sqlQuery = (String)cellEditor.databaseObjectTreeObject.getPropertyValue(cellEditor.propertyDescriptor.getId());
	textAreaSQLQuery.setText(sqlQuery);
}
 
Example 29
Project: convertigo-eclipse   File: ReferencesView.java   View source code 5 votes vote down vote up
@Override
public void createPartControl(Composite parent) {
	treeViewer = new TreeViewer(parent);
	treeViewer.setContentProvider(new ViewRefContentProvider());
	treeViewer.setLabelProvider(new ViewRefLabelProvider());
	treeViewer.setInput(null);
	treeViewer.expandAll();

	getSite().setSelectionProvider(treeViewer);
	getSite().getPage().addSelectionListener(this);
	
}
 
Example 30
Project: neoscada   File: MonitorQueryEditorForm.java   View source code 5 votes vote down vote up
@Override
protected void populateFormContent ( final ConfigurationFormToolkit toolkit, final ScrolledForm form, final ConfigurationEditorInput input )
{
    final Composite client = toolkit.createStandardComposite ( form.getBody () );
    client.setLayout ( new GridLayout ( 3, false ) );
    client.setLayoutData ( new GridData ( GridData.FILL_BOTH ) );

    toolkit.createStandardMultiText ( client, "filter", "Filter", "Filter expression", input.getDataMap (), null );
}
 
Example 31
Project: convertigo-eclipse   File: ColumnEditor.java   View source code 5 votes vote down vote up
public ColumnEditor(Composite parent) {
    super(parent);
    
    dialogTitle = "Columns definition of the table";
    columnNames = new String[] { "Label", "Initial column", "Final column", "Line index" };
    templateData = new Object[] { "label", new Integer(0), new Integer(0), new Integer(0) };
}
 
Example 32
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 33
Project: n4js   File: MultiElementListSelectionDialog.java   View source code 5 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);

	// XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425
	boolean HAS_BUG_279425 = true;
	fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425);
	fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425);

	createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
 
Example 34
Project: bdf2   File: ColumnSection.java   View source code 5 votes vote down vote up
private void createLengthLabel(Composite parent) {
	this.lengthLabel = getWidgetFactory().createCLabel(parent, "长度:");
	FormData data = new FormData();
	data.top = new FormAttachment(lengthText, 0, SWT.CENTER);
	data.left = new FormAttachment(0, 0);
	data.right = new FormAttachment(lengthText, -ITabbedPropertyConstants.HSPACE);
	this.lengthLabel.setLayoutData(data);
}
 
Example 35
Project: bdf2   File: DbTableRelationDialog.java   View source code 5 votes vote down vote up
private void createControl(Composite container) {
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 3;
	layout.verticalSpacing = 10;
	layout.marginTop = 10;
	layout.marginWidth = 10;
	this.constraintNameText = createFieldControl(container, "约束名称:");
	this.pkColumnNameText = createFieldControl(container, "主键名称:");
	this.fkColumnNameText = createFieldControl(container, "外键名称:");
	this.typeCombo = createTypeComboControl(container, "对应关系:");
	initControlData();
	addListeners();
}
 
Example 36
Project: SimQRI   File: WeibullPropertiesEditionPartImpl.java   View source code 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(Composite parent) {
	Group propertiesGroup = new Group(parent, SWT.NONE);
	propertiesGroup.setText(MetamodelMessages.WeibullPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesGroupData.horizontalSpan = 3;
	propertiesGroup.setLayoutData(propertiesGroupData);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	return propertiesGroup;
}
 
Example 37
Project: time4sys   File: CommunicationResourcePropertiesEditionPartImpl.java   View source code 5 votes vote down vote up
/**
 * @generated
 */
protected Composite createPropertiesGroup(Composite parent) {
	Group propertiesGroup = new Group(parent, SWT.NONE);
	propertiesGroup.setText(AnalysisMessages.CommunicationResourcePropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesGroupData.horizontalSpan = 3;
	propertiesGroup.setLayoutData(propertiesGroupData);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	return propertiesGroup;
}
 
Example 38
Project: gw4e.project   File: GraphModelPropertyPage.java   View source code 5 votes vote down vote up
/**
 * Label creation helper method
 * @param parent
 * @param text
 * @return
 */
protected Label createLabel(Composite parent, String text) {
	Label label = new Label(parent, SWT.LEFT);
	label.setText(text);
	GridData data = new GridData();
	data.horizontalAlignment = GridData.FILL;
	label.setLayoutData(data);
	return label;
}
 
Example 39
Project: Hydrograph   File: JoinMapDialog.java   View source code 5 votes vote down vote up
private void createDownButton(Composite composite_11) {
	btnDown = new Button(composite_11, SWT.NONE);
	btnDown.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
	btnDown.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
	
	btnDown.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			moveRowDown();
		}
	});
}
 
Example 40
Project: eZooKeeper   File: ZooKeeperServerModelFormPage.java   View source code 5 votes vote down vote up
@Override
protected Control createContents(Composite parent) {

    this.getShell().setText(_Command);

    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL);
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrolledComposite.setExpandHorizontal(true);
    Text text = new Text(scrolledComposite, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
    text.setText(_Result);
    text.pack();
    scrolledComposite.setContent(text);

    return scrolledComposite;
}