当前位置: 首页>>代码示例>>Java>>正文


Java Label.setStyleName方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Label.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setStyleName方法的具体用法?Java Label.setStyleName怎么用?Java Label.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Label的用法示例。


在下文中一共展示了Label.setStyleName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:19,代码来源:PageViewSocketImpl.java

示例2: ChipPanel

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public ChipPanel(Chip chip, String color) {
	iChip = chip;
	setStyleName("chip");
	addStyleName(color);
	iLabel = new Label(chip.getTranslatedValue());
	iLabel.setStyleName("text");
	add(iLabel);
	iButton = new HTML("×");
	iButton.setStyleName("button");
	add(iButton);
	if (chip.hasToolTip())
		setTitle(toString() + "\n" + chip.getToolTip());
	else
		setTitle(toString());
	Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:FilterBox.java

示例3: SimpleDayCell

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public SimpleDayCell(VCalendar calendar, int row, int cell) {
    this.calendar = calendar;
    this.row = row;
    this.cell = cell;
    setStylePrimaryName("v-calendar-month-day");
    caption = new Label();
    caption.setStyleName("v-calendar-day-number");
    caption.addMouseDownHandler(this);
    caption.addMouseUpHandler(this);
    add(caption);

    bottomspacer = new HTML();
    bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
    bottomspacer.setWidth(3 + "em");
    add(bottomspacer);
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:17,代码来源:SimpleDayCell.java

示例4: 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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:20,代码来源:PropertiesPanel.java

示例5: addLogo

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
private void addLogo(HorizontalPanel panel) {
  // Logo should be a link to App Inv homepage. Currently, after the user
  // has logged in, the top level *is* ODE; so for now don't make it a link.
  // Add timestamp to logo url to get around browsers that agressively cache
  // the image! This same trick is used in StorageUtil.getFilePath().
  Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
  logo.setSize("40px", "40px");
  logo.setStyleName("ode-Logo");
  String logoUrl = ode.getSystemConfig().getLogoUrl();
  if (!Strings.isNullOrEmpty(logoUrl)) {
    logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
  }
  panel.add(logo);
  panel.setCellWidth(logo, "50px");
  Label title = new Label("MIT App Inventor");
  title.setStyleName("ode-LogoText");
  VerticalPanel titleContainer = new VerticalPanel();
  titleContainer.add(title);
  panel.add(titleContainer);
  panel.setCellWidth(titleContainer, "180px");
  panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
  panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:TopPanel.java

示例6: SimpleNonVisibleComponentsPanel

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Creates new component design panel for non-visible components.
 */
public SimpleNonVisibleComponentsPanel() {
  // Initialize UI
  VerticalPanel panel = new VerticalPanel();
  panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

  heading = new Label("");
  heading.setStyleName("ya-NonVisibleComponentsHeader");
  panel.add(heading);

  componentsPanel = new FlowPanel();
  componentsPanel.setStyleName("ode-SimpleUiDesignerNonVisibleComponents");
  panel.add(componentsPanel);

  initWidget(panel);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:19,代码来源:SimpleNonVisibleComponentsPanel.java

示例7: ItemViewCarrier

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public ItemViewCarrier(String err) {
    errorView = new FlowPanel();
    errorView.setStyleName("qp-item-error");

    Label errorLabel = new Label(err);
    errorLabel.setStyleName("qp-item-error-text");
    errorView.add(errorLabel);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:ItemViewCarrier.java

示例8: createTitleWidget

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
protected Widget createTitleWidget(String index, String text) {
    Panel titlePanel = new FlowPanel();
    titlePanel.setStyleName(styleNames.QP_ITEM_TITLE());
    Label indexLabel = new Label(index + ". ");
    indexLabel.setStyleName(styleNames.QP_ITEM_TITLE_INDEX());
    Label textLabel = new Label(text);
    textLabel.setStyleName(styleNames.QP_ITEM_TITLE_TEXT());
    titlePanel.add(indexLabel);
    titlePanel.add(textLabel);
    return titlePanel;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:12,代码来源:ItemController.java

示例9: addProperty

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public void addProperty(Property p, int row) {
	grid.setWidget(row, 0, new Label(p.getName()));

	Label box = new Label();
	box.setText(p.getValue());
	grid.setWidget(row, 1, box);
	box.setStyleName("propetybox");
	properties.put(p, box);
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:10,代码来源:PropertyTable.java

示例10: JobDescPopupPanel

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
public JobDescPopupPanel(String title) {

		Label label = new Label(title);
		label.setStyleName("bda-newjob-head");
		verticalPanel.add(label);
		verticalPanel.add(createGrid());
		HorizontalPanel hpanel = new HorizontalPanel();

		hpanel.setStyleName("bda-newjob-hpanel");
		verticalPanel.add(errorLabel);
		Button cancelBtn = new Button(Constants.studioUIMsg.cancel());
		cancelBtn.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				JobDescPopupPanel.this.hide();
			}

		});

		hpanel.add(submitBtn);
		hpanel.add(cancelBtn);
		submitBtn.removeStyleName("gwt-Button");
		cancelBtn.removeStyleName("gwt-Button");
		submitBtn.addStyleName("button-style");
		cancelBtn.addStyleName("button-style");
		errorLabel.setStyleName("error-label");
		verticalPanel.add(hpanel);
		verticalPanel.addStyleName("bda-newjob");
		this.setCloseEnable(false);
	}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:32,代码来源:JobDescPopupPanel.java

示例11: DesignToolbar

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Initializes and assembles all commands into buttons in the toolbar.
 */
public DesignToolbar() {
  super();

  isReadOnly = Ode.getInstance().isReadOnly();

  projectNameLabel = new Label();
  projectNameLabel.setStyleName("ya-ProjectName");
  HorizontalPanel toolbar = (HorizontalPanel) getWidget();
  toolbar.insert(projectNameLabel, 0);

  // width of palette minus cellspacing/border of buttons
  toolbar.setCellWidth(projectNameLabel, "222px");

  addButton(new ToolbarItem(WIDGET_NAME_TUTORIAL_TOGGLE,
      MESSAGES.toggleTutorialButton(), new ToogleTutorialAction()));
  setButtonVisible(WIDGET_NAME_TUTORIAL_TOGGLE, false); // Don't show unless needed

  List<DropDownItem> screenItems = Lists.newArrayList();
  addDropDownButton(WIDGET_NAME_SCREENS_DROPDOWN, MESSAGES.screensButton(), screenItems);

  if (AppInventorFeatures.allowMultiScreenApplications() && !isReadOnly) {
    addButton(new ToolbarItem(WIDGET_NAME_ADDFORM, MESSAGES.addFormButton(),
        new AddFormAction()));
    addButton(new ToolbarItem(WIDGET_NAME_REMOVEFORM, MESSAGES.removeFormButton(),
        new RemoveFormAction()));
  }

  addButton(new ToolbarItem(WIDGET_NAME_SWITCH_TO_FORM_EDITOR,
      MESSAGES.switchToFormEditorButton(), new SwitchToFormEditorAction()), true);
  addButton(new ToolbarItem(WIDGET_NAME_SWITCH_TO_BLOCKS_EDITOR,
      MESSAGES.switchToBlocksEditorButton(), new SwitchToBlocksEditorAction()), true);

  // Gray out the Designer button and enable the blocks button
  toggleEditor(false);
  Ode.getInstance().getTopToolbar().updateFileMenuButtons(0);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:40,代码来源:DesignToolbar.java

示例12: addProperty

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Adds a new property to be displayed in the UI.
 *
 * @param property  new property to be shown
 */
void addProperty(EditableProperty property) {
  Label label = new Label(property.getCaption());
  label.setStyleName("ode-PropertyLabel");
  panel.add(label);
  PropertyEditor editor = property.getEditor();
  // Since UIObject#setStyleName(String) clears existing styles, only
  // style the editor if it hasn't already been styled during instantiation.
  if(!editor.getStyleName().contains("PropertyEditor")) {
    editor.setStyleName("ode-PropertyEditor");
  }
  panel.add(editor);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:18,代码来源:PropertiesPanel.java

示例13: initReportSection

import com.google.gwt.user.client.ui.Label; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the report section
 */
private void initReportSection() {
  final HTML reportPrompt = new HTML();
  reportPrompt.setHTML(MESSAGES.galleryReportPrompt());
  reportPrompt.addStyleName("primary-prompt");
  final TextArea reportText = new TextArea();
  reportText.addStyleName("action-textarea");
  final Button submitReport = new Button(MESSAGES.galleryReportButton());
  submitReport.addStyleName("action-button");
  final Label descriptionError = new Label();
  descriptionError.setText("Description required");
  descriptionError.setStyleName("ode-ErrorMessage");
  descriptionError.setVisible(false);
  appReportPanel.add(reportPrompt);
  appReportPanel.add(descriptionError);
  appReportPanel.add(reportText);
  appReportPanel.add(submitReport);

  final OdeAsyncCallback<Boolean> isReportdByUserCallback = new OdeAsyncCallback<Boolean>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(Boolean isAlreadyReported) {
          if(isAlreadyReported) { //already reported, cannot report again
            reportPrompt.setHTML(MESSAGES.galleryAlreadyReportedPrompt());
            reportText.setVisible(false);
            submitReport.setVisible(false);
            submitReport.setEnabled(false);
          } else {
            submitReport.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                final OdeAsyncCallback<Long> reportClickCallback = new OdeAsyncCallback<Long>(
                    // failure message
                    MESSAGES.galleryError()) {
                      @Override
                      public void onSuccess(Long id) {
                        reportPrompt.setHTML(MESSAGES.galleryReportCompletionPrompt());
                        reportText.setVisible(false);
                        submitReport.setVisible(false);
                        submitReport.setEnabled(false);
                      }
                  };
                if (!reportText.getText().trim().isEmpty()){
                  Ode.getInstance().getGalleryService().addAppReport(app, reportText.getText(),
                    reportClickCallback);
                  descriptionError.setVisible(false);
                } else {
                  descriptionError.setVisible(true);
                }
              }
            });
          }
        }
    };
  Ode.getInstance().getGalleryService().isReportedByUser(app.getGalleryAppId(),
      isReportdByUserCallback);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:60,代码来源:GalleryPage.java


注:本文中的com.google.gwt.user.client.ui.Label.setStyleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。