本文整理汇总了Java中org.eclipse.swt.custom.CLabel.setLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java CLabel.setLayoutData方法的具体用法?Java CLabel.setLayoutData怎么用?Java CLabel.setLayoutData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.CLabel
的用法示例。
在下文中一共展示了CLabel.setLayoutData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLabel
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Creates a label for a knob
* @param root
* @param knob
*/
private CLabel createLabel(final Composite root,
final Knob<Double> knob) {
// Label
String text = "100%"; //$NON-NLS-1$
final CLabel label = new CLabel(root, SWT.NONE);
label.setText(text);
label.setAlignment(SWT.LEFT);
label.setLayoutData(SWTUtil.createFillGridData());
label.setToolTipText(text);
// Listen
knob.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
updateLabel(knob, label);
}
});
// Return
return label;
}
示例2: createMainComposite
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* @see nexcore.tool.uml.ui.property.section.AbstractPropertyCommonSection#createMainComposite()
*/
@Override
public void createMainComposite() {
sectionComposite = getWidgetFactory().createComposite(parent);
sectionLayout = new GridLayout(2, false);
sectionComposite.setLayout(sectionLayout);
CLabel visibilityLabel = getWidgetFactory().createCLabel(sectionComposite,
UMLMessage.LABEL_VISIBILITY + UICoreConstant.UMLSECTION_CONSTANTS__COLON_TEXT); //$NON-NLS-1$
gridData = new GridData();
Composite visibilityComposite = getWidgetFactory().createComposite(sectionComposite);
sectionLayout = new GridLayout(4, false);
visibilityComposite.setLayout(sectionLayout);
gridData.widthHint = UICoreConstant.UMLSECTION_CONSTANTS___LABEL_WIDTH_HINT_FOR_RADIO;
visibilityLabel.setLayoutData(gridData);
publicButton = getWidgetFactory().createButton(visibilityComposite, UMLMessage.LABEL_PUBLIC, SWT.RADIO);
privateButton = getWidgetFactory().createButton(visibilityComposite, UMLMessage.LABEL_PRIVATE, SWT.RADIO);
protectedButton = getWidgetFactory().createButton(visibilityComposite, UMLMessage.LABEL_PROTECTED, SWT.RADIO);
packageButton = getWidgetFactory().createButton(visibilityComposite, UMLMessage.LABEL_PACKAGE, SWT.RADIO);
}
示例3: createControls
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
*/
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
parent = getWidgetFactory().createSection(parent, Messages.SizeSection_sizeSectionTitle, true, 4);
section = (ExpandableComposite)parent.getParent();
ASPropertyWidget hw = createWidget4Property(parent, JRDesignElement.PROPERTY_WIDTH);
CLabel lbl = hw.getLabel();
lbl.setText(Messages.SizeSection_widthLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
hw = createWidget4Property(parent, JRDesignElement.PROPERTY_HEIGHT);
lbl = hw.getLabel();
lbl.setText(Messages.SizeSection_heightLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
ASPropertyWidget w = createWidget4Property(parent, JRDesignElement.PROPERTY_STRETCH_TYPE);
GridData gd = new GridData();
gd.horizontalSpan = 3;
w.getControl().setLayoutData(gd);
}
示例4: createEditRow
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
@Override
protected void createEditRow(Composite theContainer) {
Object[] layoutData = this.getLookAndBehaviour().getLayoutDataOfControls();
CLabel labelId = new CLabel( theContainer, SWT.LEFT);
labelId.setText( this.getParameter().getId());
labelId.setLayoutData( layoutData[0]);
String toolTipString = this.getParameter().getName() + ":\n" + this.getParameter().getDescription();
labelId.setToolTipText( toolTipString);
createInputWidget( theContainer, layoutData[0]);
Button reset = new Button (theContainer, SWT.PUSH);
reset.setText ("Reset");
reset.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent theEvent) {
String defaultValueString = ParameterValueUtil.getDefaultValue( getParameter());
setInputValue( defaultValueString);
super.widgetSelected( theEvent);
}
});
theContainer.pack();
}
示例5: createComposite2
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void createComposite2() throws ForceConnectionException, ForceRemoteException {
GridData gridData6 = new GridData();
gridData6.horizontalAlignment = GridData.FILL;
gridData6.grabExcessHorizontalSpace = true;
gridData6.heightHint = 6;
gridData6.verticalAlignment = GridData.CENTER;
GridData gridData5 = new GridData();
gridData5.horizontalAlignment = GridData.FILL;
gridData5.grabExcessHorizontalSpace = true;
gridData5.grabExcessVerticalSpace = true;
gridData5.verticalAlignment = GridData.FILL;
composite2 = new Composite(sashForm1, SWT.NONE);
composite2.setLayout(new GridLayout());
textSOQL = new Text(composite2, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
textSOQL.setText(SoqlEnum.getSchemaInitalizationQuery());
textSOQL.setLayoutData(gridData5);
cLabel1 = new CLabel(composite2, SWT.NONE);
cLabel1.setText("");
cLabel1.setLayoutData(gridData6);
queryTableViewer.setProject(project);
queryTableViewer.initialize(sashForm1);
}
示例6: createMainComp
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private Composite createMainComp(Composite parent) {
GridData gridData12 = new GridData();
gridData12.horizontalSpan = 2;
GridData gridData11 = new GridData();
gridData11.horizontalSpan = 2;
GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 2;
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = GridData.FILL;
mainComp = new Composite(parent, SWT.NONE);
mainComp.setLayoutData(gridData);
cLabel = new CLabel(mainComp, SWT.NONE);
cLabel.setText(Messages.constructorFieldSelect);
cLabel.setLayoutData(gridData11);
createTreeComp();
createButtonComp();
mainComp.setLayout(gridLayout2);
createComboComp();
return mainComp;
}
示例7: createControls
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
Composite parentComposite = getWidgetFactory().createFlatFormComposite(parent);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
gridLayout.horizontalSpacing = 0;
parentComposite.setLayout(gridLayout);
CLabel nameLabel = getWidgetFactory().createCLabel(parentComposite, getLabelText(), SWT.WRAP | SWT.MULTI);
GridData gridData = new GridData();
gridData.widthHint = getStandardLabelWidth(parentComposite, new String[] { getLabelText() });
nameLabel.setLayoutData(gridData);
text = createText(parentComposite);
Button b = new Button(parentComposite, SWT.NULL);
b.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
openDialog();
}
});
b.setText("..."); //$NON-NLS-1$
}
示例8: createControls
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
*/
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
parentComposite = getWidgetFactory().createFlatFormComposite(parent);
FormData data;
text = createText(parentComposite, ""); //$NON-NLS-1$
CLabel nameLabel = getWidgetFactory().createCLabel(parentComposite, getLabelText());
data = new FormData();
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(text, -ITabbedPropertyConstants.HSPACE);
data.top = new FormAttachment(text, 0, SWT.CENTER);
nameLabel.setLayoutData(data);
listener = new TextChangeHelper() {
public void textChanged(Control control) {
handleTextModified();
}
};
listener.startListeningTo(text);
if (fireChangeOnEnter())
listener.startListeningForEnter(text);
}
示例9: createImage
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Create the image controls.
*
* @param inParent
* the parent <code>Composite</code>.
* @since 3.0
*/
private void createImage(final Composite inParent) {
descImageCanvas = new CLabel(inParent, SWT.NONE);
final GridData lData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.VERTICAL_ALIGN_BEGINNING);
lData.widthHint = 0;
lData.heightHint = 0;
descImageCanvas.setLayoutData(lData);
// hook a listener to get rid of cached images.
descImageCanvas.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent inEvent) {
for (final Iterator<Image> lImages = imageTable.values()
.iterator(); lImages.hasNext();) {
lImages.next().dispose();
}
imageTable.clear();
}
});
}
示例10: createWrapCLabel
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Creates a new <code>CLabel</code> that will wrap at the specified width and has the specified image
* @param parent the parent to add this label to
* @param text the text for the label
* @param image the image for the label
* @param hspan the h span to take up in the parent
* @param wrapwidth the with to wrap at
* @return a new <code>CLabel</code>
* @since 3.3
*/
public static CLabel createWrapCLabel(Composite parent, String text, Image image, int hspan, int wrapwidth) {
CLabel label = new CLabel(parent, SWT.NONE | SWT.WRAP);
label.setFont(parent.getFont());
if(text != null) {
label.setText(text);
}
if(image != null) {
label.setImage(image);
}
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = hspan;
gd.widthHint = wrapwidth;
label.setLayoutData(gd);
return label;
}
示例11: createPositionButton
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private Composite createPositionButton(final Composite content, final String propName, String label, String iconPath) {
final CLabel position = new CLabel(content, SWT.LEFT);
position.setBackground(content.getDisplay().getSystemColor(SWT.COLOR_WHITE));
position.setImage(Activator.getImageDescriptor(iconPath).createImage());
position.setText(label);
position.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
GridUtils.setVisible(position, store.getBoolean(propName));
return position;
}
示例12: createDialogArea
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
// create a composite with standard margins and spacing
Composite composite = (Composite)super.createDialogArea(parent);
composite.setLayout(new GridLayout(1, false));
final CLabel warning = new CLabel(composite, SWT.LEFT);
warning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
warning.setImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/error.png").createImage());
warning.setText("Expert queue configuration parameters, please use with caution.");
TableViewer viewer = new TableViewer(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
viewer.setUseHashlookup(true);
viewer.getTable().setHeaderVisible(true);
viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
createColumns(viewer);
viewer.setContentProvider(createContentProvider());
viewer.setInput(props);
final Button adv = new Button(composite, SWT.PUSH);
adv.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
adv.setText("Advanced...");
adv.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(getShell(), "org.dawnsci.commandserver.ui.activemqPage", null, null);
if (pref != null) pref.open();
}
});
return composite;
}
示例13: createContents
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
panel.setLayout(layout);
btnForceUnixNewlines = new Button(panel, SWT.CHECK);
btnForceUnixNewlines.setText(Messages.ProjectProperties_force_unix_newlines);
btnForceUnixNewlines.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false, 2, 1));
btnForceUnixNewlines.setSelection(prefs.getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true));
Label label = new Label(panel, SWT.NONE);
label.setText(Messages.projectProperties_timezone_for_all_db_connections);
cmbTimezone = new Combo(panel, SWT.BORDER | SWT.DROP_DOWN);
cmbTimezone.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
cmbTimezone.setItems(UIConsts.TIME_ZONES.toArray(new String[UIConsts.TIME_ZONES.size()]));
String tz = prefs.get(PROJ_PREF.TIMEZONE, ApgdiffConsts.UTC);
cmbTimezone.setText(tz);
cmbTimezone.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
checkSwitchWarnLbl();
}
});
lblWarn = new CLabel(panel, SWT.NONE);
lblWarn.setImage(Activator.getEclipseImage(ISharedImages.IMG_OBJS_WARN_TSK));
lblWarn.setText(Messages.ProjectProperties_change_projprefs_warn);
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, false, false, 2, 1);
gd.exclude = true;
lblWarn.setLayoutData(gd);
lblWarn.setVisible(false);
return panel;
}
示例14: createErrorComposite
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
protected void createErrorComposite(final Composite parent) {
errorMessageText = new CLabel(parent, SWT.NONE);
errorMessageText.setLeftMargin(0);
errorMessageText.setText("");
final GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.heightHint = 30 * getErrorLine();
gridData.horizontalSpan = numColumns;
errorMessageText.setLayoutData(gridData);
errorMessageText.setForeground(ColorConstants.red);
}
示例15: createContents
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
protected void createContents() {
this.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
this.setLayout(new GridLayout());
Composite composite = this;
taskNameLabel = new CLabel(composite, SWT.NONE);
taskNameLabel.setImage(processImage);
taskNameLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
taskNameLabel.setText(taskName);
subTaskLabel = new CLabel(composite, SWT.NONE);
subTaskLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
subTaskLabel.setText("");
progressBarComposite = new Composite(this, SWT.NONE);
progressBarComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
progressBarComposite.setLayout(new FillLayout());
progressBar = new ProgressBar(progressBarComposite, progressBarStyle);
progressBar.setMaximum(0);
detailLabel = new CLabel(this, SWT.NONE);
detailLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
cancelComposite = new Composite(this, SWT.NONE);
cancelComposite.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
final GridLayout gridLayout_1 = new GridLayout();
gridLayout_1.numColumns = 2;
cancelComposite.setLayout(gridLayout_1);
cancelButton = new Button(cancelComposite, SWT.NONE);
cancelButton.setLayoutData(new GridData(78, SWT.DEFAULT));
cancelButton.setText("Cancel");
}