本文整理了Java中com.google.gwt.user.client.ui.Label
类的一些代码示例,展示了Label
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label
类的具体详情如下:
包路径:com.google.gwt.user.client.ui.Label
类名称:Label
[英]A widget that contains arbitrary text, not interpreted as HTML. This widget uses a <div> element, causing it to be displayed with block layout.
This widget is capable of automatically adjusting its direction according to its content. This feature is controlled by #setDirectionEstimator or passing a DirectionEstimator parameter to the constructor, and is off by default.
com.google.gwt.examples.HTMLExample
[中]包含任意文本的小部件,不解释为HTML。此小部件使用<div>元素,使其以块布局显示。
####内置Bidi文本支持
此小部件能够根据其内容自动调整其方向。此功能由#setDirectionStimator控制,或将DirectionStimator参数传递给构造函数,默认情况下关闭。
####CSS样式规则
代码示例来源:origin: kaaproject/kaa
Button backButton = new Button();
backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton());
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.setHeight("100%");
flexTable.setWidget(0, 1, verticalPanel);
flexTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);
verticalPanel.add(firstRowPanel);
backButton.getElement().getStyle().setPaddingTop(25, Unit.PX);
backButton.getElement().getStyle().setPaddingBottom(25, Unit.PX);
firstRowPanel.setHeight("45px");
firstRowPanel.getElement().getStyle().setPaddingBottom(5, Unit.PX);
Label titleLabel = new Label();
titleLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
scope = new Label();
scope.getElement().getStyle().setFontSize(16, Unit.PX);
scope.getElement().getStyle().setFontWeight(FontWeight.NORMAL);
int horizontalMargin = 15;
scope.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);
Label versionLabel = new Label(Utils.constants.version());
versionLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
versionLabel.getElement().getStyle().setFontSize(16, Unit.PX);
versionLabel.getElement().getStyle().setFontWeight(FontWeight.NORMAL);
代码示例来源:origin: stackoverflow.com
// ...
@FXML private Label lblData;
// ...
public void updatePage(String data){
lblData.setText(data);
}
// ...
代码示例来源:origin: kaaproject/kaa
Label authorLabel = new Label(Utils.constants.author());
createdUsername = new KaaAdminSizedTextBox(-1, false);
createdUsername.setWidth("100%");
authorLabel.setVisible(!create);
createdUsername.setVisible(!create);
Label dateTimeCreatedLabel = new Label(Utils.constants.dateTimeCreated());
createdDateTime = new KaaAdminSizedTextBox(-1, false);
createdDateTime.setWidth("100%");
dateTimeCreatedLabel.setVisible(!create);
createdDateTime.setVisible(!create);
Label nameLabel = new Label(Utils.constants.name());
nameLabel.addStyleName(REQUIRED);
name = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE);
name.setWidth("100%");
Label namespaceLabel = new Label(Utils.constants.namespace());
Label classNameLabel = new Label(Utils.constants.className());
if (create) {
namespaceLabel.addStyleName(REQUIRED);
classNameLabel.addStyleName(REQUIRED);
namespace = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE);
namespace.addInputHandler(this);
description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100);
Label descriptionLabel = new Label(Utils.constants.description());
代码示例来源:origin: kaaproject/kaa
protected void constructTopPanel() {
FlowPanel panel = new FlowPanel();
panel.setSize("100%", "100%");
topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
topPanel.add(panel);
topPanel.setCellHeight(panel, "100%");
HorizontalPanel horizontalPanel = new HorizontalPanel();
Button backButton = new Button();
backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton());
backButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
backButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
Label titleLabel = new Label();
titleLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
horizontalPanel.setCellHeight(buttonsPanel, "100%");
Button saveButton = new Button();
buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
buttonsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
代码示例来源:origin: kaaproject/kaa
dateTimeCreatedLabel.setVisible(false);
createdDateTime.setVisible(false);
authorLabel.setVisible(false);
createdUsername.setVisible(false);
dateTimeModifiedLabel.setVisible(false);
modifiedDateTime.setVisible(false);
modifiedByLabel.setVisible(false);
modifiedUsername.setVisible(false);
dateTimeActivatedLabel.setVisible(false);
activatedDateTime.setVisible(false);
activatedByLabel.setVisible(false);
activatedUsername.setVisible(false);
dateTimeDeactivatedLabel.setVisible(false);
deactivatedDateTime.setVisible(false);
deactivatedByLabel.setVisible(false);
deactivatedUsername.setVisible(false);
description.setValue("");
body.setValue(null);
saveButton.setVisible(false);
activateButton.setVisible(false);
deactivateButton.setVisible(false);
if (hasLabel()) {
bodyLabel.removeStyleName(REQUIRED);
代码示例来源:origin: org.jboss.errai/errai-bus
setModal(false);
final VerticalPanel panel = new VerticalPanel();
final Label titleBarLabel = new Label("An Error Occurred in the Bus");
titleBarLabel.getElement().getStyle().setFontSize(10, Style.Unit.PT);
titleBarLabel.getElement().getStyle().setFontWeight(Style.FontWeight.BOLDER);
titleBarLabel.getElement().getStyle().setColor("white");
titleBar.add(titleBarLabel);
final Button disconnectFromServer = new Button("Disconnect Bus");
disconnectFromServer.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
final Button clearErrors = new Button("Clear Log");
clearErrors.addClickHandler(new ClickHandler() {
@Override
titleBar.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
panel.add(titleBar);
final Style s = panel.getElement().getStyle();
s.setProperty("border", "1px");
代码示例来源:origin: org.kuali.student.core/ks-common-ui
private static void updateIndicator() {
listPanel.clear();
BlockingTask task = tasks.getLast();
HorizontalPanel taskPanel = new HorizontalPanel();
Image Image = new Image("images/common/twiddler3.gif");
taskPanel.add(Image);
taskPanel.add(new Label(task.getDescription()));
listPanel.add(taskPanel);
showIndicator();
}
private static void showIndicator(){
代码示例来源:origin: kaaproject/kaa
Label keyHashLabel = new Label(Utils.constants.endpointKeyHash());
endpointKeyHash = new KaaAdminSizedTextBox(-1, false);
endpointKeyHash.setWidth("100%");
Label userIdLabel = new Label(Utils.constants.userId());
userId = new KaaAdminSizedTextBox(-1, false);
userId.setWidth("100%");
Label userExternalIdLabel = new Label(Utils.constants.userExternalId());
userExternalId = new KaaAdminSizedTextBox(-1, false);
userExternalId.setWidth("100%");
Label sdkLabel = new Label(Utils.constants.sdkProfile());
detailsTable.setWidget(row, 0, sdkLabel);
detailsTable.setWidget(row++, 1, sdkAnchor);
HorizontalPanel schemaNamePanel = new HorizontalPanel();
schemaNamePanel.setHeight("40px");
schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
Label endpointProfSchemaLabel = new Label(Utils.constants.schemaName());
Label serverProfSchemaLabel = new Label(Utils.constants.schemaName());
Label endpointConfSchemaLabel = new Label(Utils.constants.schemaName());
Label groupsLabel = new Label(Utils.constants.endpointGroups());
detailsTable.setWidget(++row, 0, groupsLabel);
groupsLabel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
代码示例来源:origin: kaaproject/kaa
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
dialogContents.add(errorPanel);
table.addStyleName(Utils.avroUiStyle.fieldWidget());
Widget schemaVersionLabel = new Label(Utils.constants.schemaVersion());
schemaVersionLabel.addStyleName(Utils.avroUiStyle.requiredField());
schemaBox = new SchemaInfoListBox();
schemaBox.setWidth("50px");
schemaBox.getElement().getStyle().setMarginLeft(10, Unit.PX);
schemaBox.setValue(currentValue);
schemaBox.setAcceptableValues(schemas);
schemaBox.addValueChangeHandler(this);
HorizontalPanel versionPanel = new HorizontalPanel();
versionPanel.add(schemaVersionLabel);
versionPanel.add(schemaBox);
schemaRecordPanel.getElement().getStyle().setPropertyPx("minWidth", 750);
schemaRecordPanel.getRecordWidget().setForceNavigation(true);
schemaRecordPanel.setPreferredHeightPx(250);
dialogContents.add(table);
saveButton.setEnabled(false);
代码示例来源:origin: org.eclipse.hudson.main/hudson-gwt-common
VerticalPanel container = new VerticalPanel();
dialog.setWidget(container);
bodyText = new Label();
bodyText.setWordWrap(true);
container.add(bodyText);
HorizontalPanel buttonPanel = new HorizontalPanel();
container.add(buttonPanel);
okButton = new Button(messages.ok());
okButton.addClickHandler(new ClickHandler()
buttonPanel.add(okButton);
代码示例来源:origin: org.jboss.errai/errai-workspaces
public WSTabSelectorDialog(Set<String> components) {
hPanel = new HorizontalPanel();
hPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
vPanel = new VerticalPanel();
hPanel.add(vPanel);
vPanel.add(message);
Button b = new Button("<span><img src='" + instanceProperties.get(LayoutParts.IconURI.name())
+ "' align='left'/>" + instanceProperties.get(LayoutParts.Name.name()) + "</span>"
, new ClickHandler() {
b.getElement().getStyle().setProperty("background", "transparent");
b.getElement().getStyle().setProperty("textAlign", "left");
b.setWidth("100%");
vPanel.add(b);
innerContainer.add(buttonPanel);
Style s = message.getElement().getStyle();
s.setProperty("padding", "8px");
s.setProperty("verticalAlign", "top");
代码示例来源:origin: kaaproject/kaa
dateTimeCreatedLabel = new Label(Utils.constants.dateTimeCreated());
dateTimeCreatedLabel.setWidth("200px");
createdDateTime = new KaaAdminSizedTextBox(-1, false, false);
createdDateTime.setWidth("200px");
dateTimeModifiedLabel = new Label(Utils.constants.dateTimeModified());
dateTimeModifiedLabel.setWidth("200px");
modifiedDateTime = new KaaAdminSizedTextBox(-1, false, false);
modifiedDateTime.setWidth("200px");
dateTimeActivatedLabel = new Label(Utils.constants.dateTimeActivated());
dateTimeActivatedLabel.setWidth("200px");
activatedDateTime = new KaaAdminSizedTextBox(-1, false, false);
activatedDateTime.setWidth("200px");
dateTimeDeactivatedLabel = new Label(Utils.constants.dateTimeDectivated());
dateTimeDeactivatedLabel.setWidth("200px");
deactivatedDateTime = new KaaAdminSizedTextBox(-1, false, false);
deactivatedDateTime.setWidth("200px");
authorLabel = new Label(Utils.constants.author());
authorLabel.setWidth("200px");
createdUsername = new KaaAdminSizedTextBox(-1, false, false);
createdUsername.setWidth("200px");
modifiedByLabel = new Label(Utils.constants.lastModifiedBy());
modifiedByLabel.setWidth("200px");
modifiedUsername = new KaaAdminSizedTextBox(-1, false, false);
modifiedUsername.setWidth("200px");
代码示例来源:origin: kaaproject/kaa
Label versionLabel = new Label(Utils.constants.version());
version = new KaaAdminSizedTextBox(-1, false);
version.setWidth("100%");
detailsTable.setWidget(0, 0, versionLabel);
detailsTable.setWidget(0, 1, version);
versionLabel.setVisible(!create);
version.setVisible(!create);
Label authorLabel = new Label(Utils.constants.author());
createdUsername = new KaaAdminSizedTextBox(-1, false);
createdUsername.setWidth("100%");
authorLabel.setVisible(!create);
createdUsername.setVisible(!create);
Label dateTimeCreatedLabel = new Label(Utils.constants.dateTimeCreated());
createdDateTime = new KaaAdminSizedTextBox(-1, false);
createdDateTime.setWidth("100%");
dateTimeCreatedLabel.setVisible(!create);
createdDateTime.setVisible(!create);
Label nameLabel = new Label(Utils.constants.name());
nameLabel.addStyleName(REQUIRED);
detailsTable.setWidget(3, 0, nameLabel);
detailsTable.setWidget(3, 1, name);
description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 80);
Label descriptionLabel = new Label(Utils.constants.description());
代码示例来源:origin: pentaho/data-access
final String radioMetaLabel,
final AsyncCallback<Boolean> onResulthandler ) {
final VerticalPanel panel = new VerticalPanel();
panel.add( new Label( message ) ); //$NON-NLS-1$
VerticalPanel vp = new VerticalPanel();
HorizontalPanel hp = new HorizontalPanel();
hp.getElement().getStyle().setMarginBottom( 10, Style.Unit.PX );
hp.getElement().getStyle().setMarginTop( 10, Style.Unit.PX );
final RadioButton dswRadio = new RadioButton( "importMetadata" );
RadioButton metadataRadio = new RadioButton( "importMetadata" );
dswRadio.setValue( true );
hp.add( dswRadio );
hp.add( new Label( radioDSWLabel ) );
vp.add( hp );
HorizontalPanel hp2 = new HorizontalPanel();
hp2.add( metadataRadio );
hp2.add( new Label( radioMetaLabel ) );
vp.add( hp2 );
panel.add( vp );
代码示例来源:origin: kaaproject/kaa
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
dialogContents.add(errorPanel);
Widget label = new Label(Utils.constants.selectNotificationTopics());
label.addStyleName(Utils.avroUiStyle.requiredField());
topic = new TopicListBox();
dialogContents.add(table);
addButton = new Button(Utils.constants.add(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Button closeButton = new Button(Utils.constants.close(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
addButton(closeButton);
addButton.setEnabled(false);
代码示例来源:origin: net.sf.javaprinciples.client/client-presentation
dialogBox.setGlassEnabled(true);
VerticalPanel dialogVPanel = new VerticalPanel();
dialogVPanel.addStyleName("dialogVPanel");
dialogVPanel.add(new HTML("<b>" + title + "</b>"));
dialogVPanel.add(new HTML("<br><b>" + message + "</b><br><br>"));
dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
HorizontalPanel buttons = new HorizontalPanel();
dialogVPanel.add(buttons);
Button ok = new Button("OK");
buttons.add(ok);
ok.addClickHandler(new ClickHandler()
if (style == Style.OK_CANCEL)
Label gap = new Label("");
gap.setWidth("10px");
buttons.add(gap);
Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addClickHandler(new ClickHandler()
代码示例来源:origin: org.uberfire/uberfire-widgets-commons
public LazyStackPanelHeader(String headerText) {
this();
final Label titleLabel = new Label(headerText);
titleLabel.setStyleName("guvnor-cursor");
titleLabel.addClickHandler(expandClickHandler);
container.add(titleLabel);
}
代码示例来源:origin: org.jbpm/jbpm-gwt-form-api
public ConfirmDialog(String warningText) {
super(false, true);
warning.setText(warningText);
VerticalPanel panel = new VerticalPanel();
panel.add(warning);
HorizontalPanel buttons = new HorizontalPanel();
Button cancelButton = new Button("Cancel");
cancelButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
okButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
buttons.add(okButton);
buttons.add(cancelButton);
panel.add(buttons);
add(panel);
int height = RootPanel.getBodyElement().getClientHeight();
int width = RootPanel.getBodyElement().getClientWidth();
setSize("300px", "100px");
setPopupPosition(width / 2 - 150, height / 2 - 50);
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client
/** {@inheritDoc} */
@Override
public void show(List<String> matches) {
container.clear();
for (String fqn : matches) {
final Label label = new Label(fqn);
if (fqn.equals(selectedImport)) {
selectedLabel = label;
selectedLabel.getElement().getStyle().setBackgroundColor(getEditorSelectionColor());
}
label.getElement().getStyle().setColor(getMainFontColor());
label.getElement().getStyle().setCursor(POINTER);
label.addClickHandler(
clickEvent -> {
selectedLabel.getElement().getStyle().setBackgroundColor("initial");
selectedLabel = label;
label.getElement().getStyle().setBackgroundColor(getEditorSelectionColor());
});
container.add(label);
}
show();
}
代码示例来源:origin: org.jboss.errai/errai-widgets
public WSModalDialog(String title) {
window = new WSWindowPanel(title);
dockPanel = new DockPanel();
dockPanel.setWidth("400px");
dockPanel.add(new Image(imageBundle.redFlag()), DockPanel.WEST);
dockPanel.add(message, DockPanel.CENTER);
message.getElement().getStyle().setProperty("padding", "0px");
HorizontalPanel buttonPanel = new HorizontalPanel();
okButton = new Button("OK");
okListener = new ClickCallbackListener(this, AcceptsCallback.MESSAGE_OK);
okButton.addClickHandler(okListener);
buttonPanel.add(okButton);
cancelButton = new Button("Cancel");
cancelListener = new ClickCallbackListener(this, AcceptsCallback.MESSAGE_CANCEL);
cancelButton.addClickHandler(cancelListener);
dockPanel.add(cancelButton, DockPanel.SOUTH);
buttonPanel.add(cancelButton);
dockPanel.add(buttonPanel, DockPanel.SOUTH);
dockPanel.setCellHorizontalAlignment(buttonPanel, DockPanel.ALIGN_RIGHT);
dockPanel.setCellHeight(buttonPanel, "45px");
window.add(dockPanel);
}
内容来源于网络,如有侵权,请联系作者删除!