本文整理匯總了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;
}