本文整理匯總了Java中org.eclipse.swt.widgets.Label.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setText方法的具體用法?Java Label.setText怎麽用?Java Label.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Label
的用法示例。
在下文中一共展示了Label.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private void initialize() {
labelSyntaxe = new Label(this, SWT.NONE);
labelSyntaxe.setText("SQL query syntax examples :\n");
labelSyntaxe.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
labelSQLQuery = new Label(this, SWT.NONE);
labelSQLQuery.setFont(new Font(null,"Tahoma",8,1));
labelSQLQuery.setText("SELECT * FROM EMPLOYEES WHERE (NAME='{parameter_name}')\n"
+ "{? = CALL STORED_FUNCTION({parameter_name})}\n"
+ "{CALL STORED_PROCEDURE({parameter_name})}\n\n");
labelSQLQuery.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
textAreaSQLQuery = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
textAreaSQLQuery.setFont(new Font(null,"Tahoma",10,0));
textAreaSQLQuery.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
GridLayout gridLayout = new GridLayout();
this.setLayout(gridLayout);
setSize(new org.eclipse.swt.graphics.Point(402,289));
}
示例2: DescriptorLabel
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public DescriptorLabel ( final Composite parent, final int style, final String text, final DataItemDescriptor descriptor )
{
super ( parent, SWT.NONE );
setLayout ( new FillLayout () );
Label label = new Label ( this, style );
if ( text != null )
{
label.setText ( text );
}
// TODO: make properties
if ( SessionManager.getDefault ().hasRole ( "developer" ) ) //$NON-NLS-1$
{
label.setToolTipText ( String.format ( "%s", descriptor ) ); //$NON-NLS-1$
}
}
示例3: createProjectSection
import org.eclipse.swt.widgets.Label; //導入方法依賴的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);
}
示例4: createLabelledCombo
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private CCombo createLabelledCombo(Composite content, String slabel) {
Label label = new Label(content, SWT.NONE);
label.setBackground(content.getDisplay().getSystemColor(SWT.COLOR_WHITE));
label.setText(" "+slabel+" ");
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true));
CCombo ret = new CCombo(content, SWT.READ_ONLY|SWT.BORDER);
ret.setItems(getNames());
GridData fill = new GridData(SWT.FILL, SWT.CENTER, true, true);
fill.widthHint=100;
ret.setLayoutData(fill);
return ret;
}
示例5: initialize
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
protected void initialize() {
Label label0 = new Label (this, SWT.NONE);
label0.setText ("Please choose an element to import into a sequence's step:");
GridData data = new GridData ();
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
data.heightHint = 200;
list = new List(this, SWT.BORDER | SWT.V_SCROLL);
list.setLayoutData (data);
GridData gridData2 = new GridData();
gridData2.horizontalSpan = 2;
gridData2.verticalAlignment = GridData.CENTER;
gridData2.horizontalAlignment = GridData.FILL;
labelProgression = new Label(this, SWT.NONE);
labelProgression.setText("Progression");
labelProgression.setLayoutData(gridData2);
GridData gridData4 = new GridData();
gridData4.horizontalSpan = 2;
gridData4.verticalAlignment = GridData.CENTER;
gridData4.horizontalAlignment = GridData.FILL;
progressBar = new ProgressBar(this, SWT.NONE);
//progressBar.setBounds(new Rectangle(16, 349, 571, 17));
progressBar.setLayoutData(gridData4);
GridLayout gridLayout = new GridLayout();
setLayout(gridLayout);
setSize(new Point(408, 251));
}
示例6: initialize
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
* This method initializes this
*
*/
private void initialize() {
GridData gridData11 = new org.eclipse.swt.layout.GridData();
gridData11.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData11.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
GridData gridData2 = new org.eclipse.swt.layout.GridData();
gridData2.horizontalSpan = 2;
label1 = new Label(this, SWT.NONE);
label1.setText("The chosen project template includes a CICS type connector. \n\nThis connector needs a CICS Transaction Gateway (CTG) name, server address and server port.\n\nPlease provide this information here\n\n");
label1.setLayoutData(gridData2);
GridData gridData1 = new org.eclipse.swt.layout.GridData();
gridData1.grabExcessHorizontalSpace = true;
gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.grabExcessHorizontalSpace = false;
gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData.grabExcessVerticalSpace = false;
label = new Label(this, SWT.NONE);
label.setText("CTG Configuration name");
label.setLayoutData(gridData);
ctgName = new Text(this, SWT.BORDER);
ctgName.setLayoutData(gridData1);
label2 = new Label(this, SWT.NONE);
label2.setText("CTG Sever address");
ctgServer = new Text(this, SWT.BORDER);
ctgServer.setLayoutData(gridData11);
label5 = new Label(this, SWT.NONE);
label5.setText("CTG Server port");
ctgPort = new Text(this, SWT.BORDER);
ctgName.addModifyListener(modifyListener);
ctgPort.addModifyListener(modifyListener);
ctgServer.addModifyListener(modifyListener);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
this.setLayout(gridLayout);
}
示例7: createControl
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@SuppressWarnings("restriction")
@Override
public void createControl(Composite parent)
{
Label label = new Label(parent, SWT.NULL);
label.setText("JPF Classpath");
setControl(label);
}
示例8: labelWidget
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public Label labelWidget(Composite parent, int style, int[] bounds,
String value, Image image) {
Label label = new Label(parent, style);
label.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
label.setText(value);
label.setImage(image);
return label;
}
示例9: InterfacesComponent
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
* Creates a new interfaces component inside the parent composite using the given model.
*
* @param interfacesContainingModel
* A interface containing model
* @param container
* The component container
*/
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
WizardComponentContainer container) {
super(container);
this.model = interfacesContainingModel;
Composite parent = getParentComposite();
Label interfacesLabel = new Label(parent, SWT.NONE);
GridData interfacesLabelGridData = fillLabelDefaults();
interfacesLabelGridData.verticalAlignment = SWT.TOP;
interfacesLabel.setLayoutData(interfacesLabelGridData);
interfacesLabel.setText("Interfaces:");
interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());
interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());
interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesAddButton.setText("Add...");
interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesRemoveButton.setText("Remove");
interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
setupBindings();
}
示例10: initialize
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
* This method initializes this
*
*/
private void initialize() {
GridData gridData2 = new org.eclipse.swt.layout.GridData();
gridData2.horizontalSpan = 2;
label1 = new Label(this, SWT.NONE);
label1.setText("The chosen project template includes a ''screen type'' connector. \n\nThis connector needs a destination address as an hostname (or IP adress) and optionally a port.\n ");
label1.setLayoutData(gridData2);
GridData gridData1 = new org.eclipse.swt.layout.GridData();
gridData1.grabExcessHorizontalSpace = true;
gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.grabExcessHorizontalSpace = false;
gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData.grabExcessVerticalSpace = false;
label = new Label(this, SWT.NONE);
label.setText("Server address");
label.setLayoutData(gridData);
server = new Text(this, SWT.BORDER);
server.setLayoutData(gridData1);
label5 = new Label(this, SWT.NONE);
label5.setText("Port");
port = new Text(this, SWT.BORDER);
server.addModifyListener(modifyListener);
port.addModifyListener(modifyListener);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
this.setLayout(gridLayout);
}
示例11: createLabel
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
* 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;
}
示例12: createNewFilePage
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@Override
protected WizardNewFileCreationPage createNewFilePage() {
return new NewFilePage(getSelection(), fileExt) {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
Composite control = (Composite) getControl();
Composite extensionGroup = new Composite(control, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
extensionGroup.setLayout(layout);
extensionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label refOccieLabel = new Label(extensionGroup, SWT.NONE);
refOccieLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
refOccieLabel.setText(Messages.NewExtensionWizard_RefExtensionLabel);
refOccieLabel.setFont(parent.getFont());
Composite composite = new Composite(extensionGroup, SWT.NULL);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
composite.setLayoutData(layoutData);
TableColumnLayout tableLayout = new TableColumnLayout();
composite.setLayout(tableLayout);
Table table = new Table(composite,
SWT.CHECK | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
refExtensionViewer = new CheckboxTableViewer(table);
refExtensionViewer.setContentProvider(ArrayContentProvider.getInstance());
Collection<String> registeredExtensions = new ArrayList<String>(
OcciRegistry.getInstance().getRegisteredExtensions());
refExtensionViewer.setInput(registeredExtensions);
}
};
}
示例13: createDialogArea
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@Override
protected Control createDialogArea ( final Composite parent )
{
getShell ().setText ( "Time and date" );
final Composite base = (Composite)super.createDialogArea ( parent );
final Composite wrapper = new Composite ( base, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 2, false ) );
wrapper.setLayoutData ( new GridData ( GridData.FILL_BOTH ) );
final Label label = new Label ( wrapper, SWT.NONE );
label.setText ( "Input:" );
this.input = new Text ( wrapper, SWT.BORDER );
this.input.addModifyListener ( new ModifyListener () {
@Override
public void modifyText ( final ModifyEvent e )
{
update ();
}
} );
this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
this.resultControl = new Label ( wrapper, SWT.NONE );
this.resultControl.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false, 2, 1 ) );
if ( this.time != null )
{
this.input.setText ( String.format ( "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL", this.time ) );
}
return base;
}
示例14: createUILabelPassword
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
*
*/
private void createUILabelPassword() {
// Create the label
Label label = new Label(fCompositeLogin, SWT.NONE);
label.setText("&Password:"); //NON-NLS-1
// Configure layout data
GridData data = new GridData();
data.horizontalIndent = F_LABEL_HORIZONTAL_INDENT;
label.setLayoutData(data);
}
示例15: BreadcrumbItem
import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public BreadcrumbItem ( final BreadcrumbBar parent, final boolean last )
{
this.horizontal = parent.isHorizontal ();
this.parent = parent;
this.wrapper = new Composite ( parent.getComposite (), SWT.NONE );
parent.addChild ( this );
final GridLayout layout = new GridLayout ( last ? 1 : 2, false );
layout.marginHeight = layout.marginWidth = 0;
layout.horizontalSpacing = layout.verticalSpacing = 0;
if ( this.horizontal )
{
layout.horizontalSpacing = 5;
}
else
{
layout.verticalSpacing = 5;
}
this.wrapper.setLayout ( layout );
this.item = new CLabel ( this.wrapper, SWT.NONE );
this.item.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, true, true ) );
if ( !last )
{
final Label label = new Label ( this.wrapper, SWT.NONE );
if ( this.horizontal )
{
label.setText ( Messages.BreadcrumbNavigator_Splitter_Horizontal );
}
else
{
label.setText ( Messages.BreadcrumbNavigator_Splitter_Vertical );
}
label.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, true, true ) );
}
if ( this.horizontal )
{
this.wrapper.setLayoutData ( new GridData ( SWT.BEGINNING, SWT.CENTER, false, true ) );
}
else
{
this.wrapper.setLayoutData ( new GridData ( SWT.FILL, SWT.BEGINNING, true, false ) );
}
this.item.addMouseListener ( new MouseAdapter () {
@Override
public void mouseUp ( final MouseEvent e )
{
handleSelected ();
}
} );
}