本文整理汇总了Java中org.eclipse.swt.widgets.Composite类的典型用法代码示例。如果您正苦于以下问题:Java Composite类的具体用法?Java Composite怎么用?Java Composite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Composite类属于org.eclipse.swt.widgets包,在下文中一共展示了Composite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomElementSelectionForm
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* 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());
}
示例2: createProjectSection
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* 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);
}
示例3: initialize
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
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);
}
示例4: createControls
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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);
}
示例5: createDialogArea
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* 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;
}
示例6: IntListParameter
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
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());
}
});
}
示例7: createControls
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:polarsys,项目名称:time4sys,代码行数:33,代码来源:ResourceSchedulingParameterValuePropertiesEditionPartForm.java
示例8: createViewer
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
@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;
}
示例9: ChartComposite
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* 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
);
}
示例10: createControls
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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);
}
示例11: createButtonBar
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
@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;
}
示例12: createControls
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:polarsys,项目名称:time4sys,代码行数:33,代码来源:ResourceProtectionParameterValuePropertiesEditionPartImpl.java
示例13: createFigure
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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;
}
示例14: createFigure
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
/**
* {@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;
}
示例15: attachWidget
import org.eclipse.swt.widgets.Composite; //导入依赖的package包/类
@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;
}