本文整理汇总了Java中com.google.gwt.user.client.ui.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于com.google.gwt.user.client.ui包,在下文中一共展示了Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPageViewCarrier
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
@Override
public void setPageViewCarrier(PageViewCarrier pageViewCarrier) {
view.getTitlePanel().clear();
view.getTitlePanel().add(pageViewCarrier.getPageTitle());
if (pageViewCarrier.hasContent()) {
Panel contentPanel = new FlowPanel();
if (pageViewCarrier.pageType == PageType.ERROR) {
contentPanel.setStyleName(styleNames.QP_PAGE_ERROR());
Label errorLabel = new Label(pageViewCarrier.errorMessage);
errorLabel.setStyleName(styleNames.QP_PAGE_ERROR_TEXT());
contentPanel.add(errorLabel);
}
view.getItemsPanel().clear();
view.getItemsPanel().add(contentPanel);
}
}
示例2: Leaf
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
/**
* Create a leaf node for the Tree
*
* @param name name of the TreeItem
* @param module Attached moduleId for the TreeItem
*/
public Leaf(String name,
T module,
String style) {
// add context menu
this.menu = new ContextMenu();
label = new Label(name);
this.setWidget(label);
label.addMouseDownHandler(new MouseDownHandler() {
@Override
public void onMouseDown(MouseDownEvent event) {
// display the context menu when right click
if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
menu.setPopupPosition(event.getClientX(), event.getClientY());
menu.show();
}
}
});
// set moduleId
this.module = module;
this.addStyleName("bda-treeleaf");
if (!style.equals(""))
this.addStyleName(style);
}
示例3: initGridHead
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
protected void initGridHead(int size){
this.setSpacing(3);
paramsGrid = new Grid(size, 3);
paramsGrid.setStyleName("gridstyle");
paramsGrid.setBorderWidth(1);
paramsGrid.setWidth("250px");
Label nameLabel = new Label(Constants.studioUIMsg.parameter());
nameLabel.setWidth("65px");
paramsGrid.setWidget(0, 0, nameLabel);
Label typeLabel = new Label(Constants.studioUIMsg.type());
typeLabel.setWidth("40px");
paramsGrid.setWidget(0, 1, typeLabel);
Label valueLabel = new Label(Constants.studioUIMsg.value());
paramsGrid.setWidget(0, 2, valueLabel);
paramsGrid.setVisible(false);
}
示例4: BaseWidget
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
public BaseWidget(String text, String id) {
this.label = new Label(text);
p.setWidget(new HTML(text));
p.getElement().getStyle().setZIndex(6);
this.id = id;
label.setStyleName("basewidget");
label.setTitle(text);
canvas = new GWTCanvas();
abspanel.add(label, 0, 0);
abspanel.add(canvas, 0, 0);
focusPanel.add(abspanel.asWidget());
focusPanel.setHeight("35px");
focusPanel.setFocus(true);
focusPanel.setStyleName("basefocuspanel");
abspanel.setHeight("100%");
initWidget(focusPanel);
addDomHandler(this, MouseDownEvent.getType());
addDomHandler(this, MouseUpEvent.getType());
addDomHandler(this, MouseOverEvent.getType());
addDomHandler(this, MouseOutEvent.getType());
}
示例5: getCell
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
protected Widget getCell(final AttributeInterface feature, final AttributesColumn column, final int idx) {
switch (column) {
case NAME:
return new Label(feature.getName() == null ? "" : feature.getName(), false);
case CODE:
return new Label(feature.getCode() == null ? "" : feature.getCode(), false);
case TYPE:
if (feature.getType() == null)
return null;
else {
Label type = new Label(feature.getType().getAbbreviation(), false);
type.setTitle(feature.getType().getLabel());
return type;
}
case PARENT:
return new Label(feature.getParentName() == null ? "" : feature.getParentName(), false);
case INSTRUCTORS:
if (feature.hasInstructors())
return new InstructorsCell(feature);
else
return null;
default:
return null;
}
}
示例6: initPageAsync
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
public void initPageAsync(final String page) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
init(page);
LoadingWidget.getInstance().hide();
}
public void onFailure(Throwable reason) {
Label error = new Label(MESSAGES.failedToLoadPage(reason.getMessage()));
error.setStyleName("unitime-ErrorMessage");
RootPanel loading = RootPanel.get("UniTimeGWT:Loading");
if (loading != null) loading.setVisible(false);
RootPanel.get("UniTimeGWT:Body").add(error);
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadPage(reason.getMessage()), reason);
}
});
}
示例7: initSalvageSection
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the salvage section
* @param container The container that salvage label reside
*/
private void initSalvageSection(Panel container) { //TODO: Update the location of this button
if (!canSalvage()) { // Permitted to salvage?
return;
}
final Label salvagePrompt = new Label("salvage");
salvagePrompt.addStyleName("primary-link");
container.add(salvagePrompt);
salvagePrompt.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final OdeAsyncCallback<Void> callback = new OdeAsyncCallback<Void>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Void bool) {
salvagePrompt.setText("done");
}
};
Ode.getInstance().getGalleryService().salvageGalleryApp(app.getGalleryAppId(), callback);
}
});
}
示例8: UniTimeVersion
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
public UniTimeVersion() {
iLabel = new Label();
RPC.execute(new MenuInterface.VersionInfoRpcRequest(), new AsyncCallback<VersionInfoInterface>() {
@Override
public void onSuccess(VersionInfoInterface result) {
iLabel.setText(MESSAGES.pageVersion(result.getVersion(), result.getReleaseDate()));
}
@Override
public void onFailure(Throwable caught) {
}
});
initWidget(iLabel);
}
示例9: addConfig
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
private void addConfig(Config config) {
List<Widget> line = new ArrayList<Widget>();
Node node = new Node(null, MESSAGES.labelConfiguration(config.getAbbv()), config);
line.add(node);
line.add(new Label(config.hasInstructionalMethod() ? config.getInstructionalMethod() : ""));
line.add(new UniTimeTable.NumberCell(config.getLimit() == null ? MESSAGES.configUnlimited() : config.getLimit().toString()));
line.add(new Label(""));
line.add(new Label(""));
line.add(new Label(""));
line.add(new Label(""));
iConfigs.put(config.getId(), node);
node.setRow(addRow(node, line));
for (Subpart subpart: config.getSubparts()) {
if (subpart.getParentId() == null)
addClasses(node, subpart, null);
}
}
示例10: initializew3wPanel
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
private void initializew3wPanel() {
w3wPanel = new HorizontalPanel();
w3wPanel.setSpacing(5);
w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
+ "border-radius: 5px 10px;" + "opacity: 0.8}");
w3wPanel.setStyleName("w3wPanel");
w3wPanel.setWidth("415px");
wordsLabel = new Label();
w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
.setText(UIMessages.INSTANCE.what3Words())
.setTitle("https://what3words.com/").build();
w3wAnchor.getElement().getStyle().setColor("#FF0000");
w3wAnchor.setVisible(false);
w3wPanel.add(w3wAnchor);
w3wPanel.add(wordsLabel);
}
示例11: PropertiesPanel
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
/**
* Creates a new properties panel.
*/
public PropertiesPanel() {
// Initialize UI
VerticalPanel outerPanel = new VerticalPanel();
outerPanel.setWidth("100%");
componentName = new Label("");
componentName.setStyleName("ode-PropertiesComponentName");
outerPanel.add(componentName);
panel = new VerticalPanel();
panel.setWidth("100%");
panel.setStylePrimaryName("ode-PropertiesPanel");
outerPanel.add(panel);
initWidget(outerPanel);
}
示例12: initAppTitle
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the app's title section
* @param container The container that title resides
*/
private void initAppTitle(Panel container) {
if (newOrUpdateApp()) {
// GUI for editable title container
if (editStatus==NEWAPP) {
// If it's new app, give a textual hint telling user this is title
titleText.setText(app.getTitle());
} else if (editStatus==UPDATEAPP) {
// If it's not new, just set whatever's in the data field already
titleText.setText(app.getTitle());
}
titleText.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
app.setTitle(titleText.getText());
}
});
titleText.addStyleName("app-desc-textarea");
container.add(titleText);
container.addStyleName("app-title-container");
} else {
Label title = new Label(app.getTitle());
title.addStyleName("app-title");
container.add(title);
}
}
示例13: getFilePanel
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
private FormPanel getFilePanel() {
VerticalLayoutContainer layoutContainer = new VerticalLayoutContainer();
file = new FileUploadField();
file.setName(UIMessages.INSTANCE.gdidFileUploadFieldText());
file.setAllowBlank(false);
layoutContainer.add(new FieldLabel(file, UIMessages.INSTANCE.file()),
new VerticalLayoutData(-18, -1));
layoutContainer.add(new Label(UIMessages.INSTANCE.maxFileSizeText()),
new VerticalLayoutData(-18, -1));
uploadPanel = new FormPanel();
uploadPanel.setMethod(Method.POST);
uploadPanel.setEncoding(Encoding.MULTIPART);
uploadPanel.setAction("fileuploadzip.do");
uploadPanel.setWidget(layoutContainer);
return uploadPanel;
}
示例14: createSeparatorPanel
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
private void createSeparatorPanel() {
separatorPanel = new HorizontalPanel();
separatorPanel.setSpacing(1);
separatorPanel.setWidth("100%");
separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
separatorPanel
.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
separatorPanel.add(new Label(UIMessages.INSTANCE
.separator(DEFAULT_CSV_SEPARATOR)));
separatorTextField = new TextField();
separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
separatorTextField.setWidth(30);
separatorPanel.add(separatorTextField);
}
示例15: createPanel
import com.google.gwt.user.client.ui.Label; //导入依赖的package包/类
private Widget createPanel() {
VerticalLayoutContainer container = new VerticalLayoutContainer();
container.setScrollMode(ScrollMode.AUTO);
container.setSize("450px", "160px");
Label bboxLabel = new Label("Bbox (" + UIMessages.INSTANCE.lowerLeftXField() + ", " + UIMessages.INSTANCE.lowerLeftYField() +
", " + UIMessages.INSTANCE.upperRightXField() + ", " + UIMessages.INSTANCE.upperRightYField() + ")");
bboxLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD);
container.add(bboxLabel);
bboxField = new TextField();
bboxField.setEmptyText(UIMessages.INSTANCE.bboxFieldCustomExtent());
bboxField.setWidth("450px");
container.add(bboxField);
return container;
}