當前位置: 首頁>>代碼示例>>Java>>正文


Java HTML.addStyleName方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.HTML.addStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java HTML.addStyleName方法的具體用法?Java HTML.addStyleName怎麽用?Java HTML.addStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.HTML的用法示例。


在下文中一共展示了HTML.addStyleName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initAppShare

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
/**
 * Helper method called by constructor to initialize the report section
 */
private void initAppShare() {
  final HTML sharePrompt = new HTML();
  sharePrompt.setHTML(MESSAGES.gallerySharePrompt());
  sharePrompt.addStyleName("primary-prompt");
  final TextBox urlText = new TextBox();
  urlText.addStyleName("action-textbox");
  urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId());
  urlText.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      urlText.selectAll();
    }
  });
  appSharePanel.add(sharePrompt);
  appSharePanel.add(urlText);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:20,代碼來源:GalleryPage.java

示例2: DropDown

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public DropDown() {
    current = new FlexTable();
    current.addStyleName("datatable");
    itemlist = new FlexTable();
    dropdown = new PopupPanel(true);
    scroller = new ScrollPanel();
    scroller.add(itemlist);
    dropdown.add(scroller);
    down =new HTML(" ▼");
    down.addStyleName("current-item");
    initWidget(current);
    HTML load = new HTML("loading...");
    load.addStyleName("current-item");
    current.setWidget(0, 0, load);
    current.setWidget(0, 1, down);
    current.addClickHandler(show);
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:18,代碼來源:DropDown.java

示例3: ImageUnitWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public ImageUnitWidget(ImageUnit unit) {

		super();
		
		MaterialColumn imageColumn = new MaterialColumn();
		imageColumn.setGrid("s12");
		imageColumn.setTextAlign(TextAlign.CENTER);
			image = new MaterialImage();
		imageColumn.add(image);
		getContentRow().add(imageColumn);

		captionColumn = new MaterialColumn();
		captionColumn.setGrid("s12");
		captionColumn.setTextAlign(TextAlign.CENTER);
			caption = new HTML();
			caption.addStyleName(res.style().caption());
		captionColumn.add(caption);
		getContentRow().add(captionColumn);

		if (unit != null)
			setUnit(unit);
		
	}
 
開發者ID:vsite-hr,項目名稱:mentor,代碼行數:24,代碼來源:ImageUnitWidget.java

示例4: insertFileRow

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private void insertFileRow(final FileWrapper file) {
	int numRows = folderDisplayTable.getRowCount();

	CheckBox checkBox = new CheckBox();
	final String fileName = file.getName();
	FolderTableRow fileTableRow = new FolderTableRow(checkBox, file);
	folderTableRows.add(fileTableRow);
	folderDisplayTable.setWidget(numRows, 0, checkBox);
	HTML fileIconedName = getFileIconedName(fileName, file.getKind());
	fileIconedName.addStyleName(FolderManagementConstants.CURSOR_HAND);
	addHandlersToFileIconedName(file, fileName, fileIconedName);

	folderDisplayTable.setWidget(numRows, 1, fileIconedName);
	folderDisplayTable.setText(numRows, 2, file.getModified());
	folderDisplayTable.setText(numRows, 3, file.getKind().toString());
	folderDisplayTable.getCellFormatter().addStyleName(numRows, 0, FolderManagementConstants.FILES_TABLE_SMALL_COLUMN);
	folderDisplayTable.getCellFormatter().addStyleName(numRows, 1, FolderManagementConstants.TOP_LINKS);
	folderDisplayTable.getCellFormatter().addStyleName(numRows, 2, FolderManagementConstants.TOP_LINKS);
	folderDisplayTable.getCellFormatter().addStyleName(numRows, 3, FolderManagementConstants.TOP_LINKS);
	if (numRows % 2 != 0) {
		folderDisplayTable.getRowFormatter().addStyleName(numRows, FolderManagementConstants.FILES_TABLE_ODD);
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:24,代碼來源:FolderTableView.java

示例5: getEndPointDetails

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private Widget getEndPointDetails(final String css, Date time,
		String address, final Wgs84LatLonBean position) {
	HTML line = new HTML();
	line.addStyleName("itinerary-details-line");
	line.addStyleName("itinerary-details-" + css);
	line.addStyleName(css + "-icon");
	String html = "<span class='time'>" + FormatUtils.formatTime(time)
			+ "</span> - " + FormatUtils.formatAddress(address);
	line.setHTML(html);
	final String infoHtml = "<div class='info-panel-" + css + " " + css
			+ "-icon'>" + html + "</div>";
	line.addMouseOverHandler(new MouseOverHandler() {

		@Override
		public void onMouseOver(MouseOverEvent event) {
			if (selected)
				listener.onItineraryStepClicked(infoHtml, position);
		}
	});
	return line;
}
 
開發者ID:mecatran,項目名稱:OpenTripPlanner-client-gwt,代碼行數:22,代碼來源:ItineraryDetailsWidget.java

示例6: makeFailureMessage

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public Panel makeFailureMessage(String message, int width, int height, boolean decorated) {
    VerticalPanel panel= new VerticalPanel();
    HTML header = new HTML(getTitle());
    Widget msg = GwtUtil.centerAlign(new HTML(message));
    header.addStyleName("preview-title");
    GwtUtil.setStyle(msg, "padding", "5px");
    panel.add(header);
    panel.add(msg);
    panel.setPixelSize(width, height);

    Panel retval= panel;

    if (decorated) {
        DecoratorPanel dp= new DecoratorPanel();
        dp.setWidget(panel);
        retval= dp;
    }
    return retval;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:20,代碼來源:MiniPlotWidget.java

示例7: setNews

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
protected void setNews(List<NewsItem> news) {
	newsPanel.clear();

	if (!news.isEmpty()) {
		// newsPanel.setWidth("100%");
		SimpleCaptionPanel border = new SimpleCaptionPanel("News");
		// border.setWidth("100%");
		newsPanel.add(border);

		VerticalPanel panel = new VerticalPanel();
		border.setContentWidget(panel);

		for (NewsItem n : news) {
			HorizontalPanel row = new HorizontalPanel();
			HTML label = new HTML(n.getText());
			label.addStyleName("boldText");
			row.add(label);
			panel.add(row);
		}
	}

}
 
開發者ID:dawg6,項目名稱:dhcalc,代碼行數:23,代碼來源:MainPanel.java

示例8: initComponents

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
/**
   * Helper method called by constructor to initialize ui components
   */
  private void initComponents() {
    // Initialize UI
    panel = new VerticalPanel();
    panel.setWidth("100%");
    galleryGUI = new FlowPanel();
    appSingle = new FlowPanel();
    appDetails = new FlowPanel();
    appHeader = new FlowPanel();
    appInfo = new FlowPanel();
    appAction = new FlowPanel();
    appAuthor = new FlowPanel();
    appMeta = new FlowPanel();
    appDates = new FlowPanel();
    appPrimaryWrapper = new FlowPanel();
    appSecondaryWrapper = new FlowPanel();
    appDescPanel = new FlowPanel();
    appReportPanel = new FlowPanel();
    appSharePanel = new FlowPanel();
    appActionTabs = new TabPanel();
    sidebarTabs = new TabPanel();
    appComments = new FlowPanel();
    appCommentsList = new FlowPanel();
    appsByAuthor = new FlowPanel();
    appsByTags = new FlowPanel();
    appsRemixes = new FlowPanel();
    returnToGallery = new FlowPanel();
//    tagSelected = "";

    appCreated = new Label();
    appChanged = new Label();
    descBox = new FlowPanel();
    titleBox = new FlowPanel();
    desc = new TextArea();
    titleText = new TextArea();
    moreInfoText = new TextArea();
    creditText = new TextArea();
    ccLicenseRef = new HTML(MESSAGES.galleryCcLicenseRef());
    ccLicenseRef.addStyleName("app-action-html");
  }
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:43,代碼來源:GalleryPage.java

示例9: setSelectedIndex

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public void setSelectedIndex(int index) {
    if (index >= 0 && index < items.size() ) {
        value = items.get(index);
        HTML html = new HTML(value);
        html.addStyleName("current-item");
        current.setWidget(0, 0, html);
        selectedIndex = index;
    }
    
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:11,代碼來源:DropDown.java

示例10: addItem

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public void addItem(String item) {
    items.add(item);
    if ( items.size() == 1 ) {
        value = item;
        HTML currentValue = new HTML(value);
        currentValue.addStyleName("current-item");
        current.setWidget(0, 0, currentValue);
    }
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:10,代碼來源:DropDown.java

示例11: updateItemTitle

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private void updateItemTitle() {
    HTML titleHTML= new HTML(_title);
    titleHTML.addStyleName("group-title");
    FlexTable.FlexCellFormatter formatter= _content.getFlexCellFormatter();
    _content.setWidget(0, TITLE_POS,titleHTML);
    String width;
    if (_title.length()< 20)  width= "200px";
    else if (_title.length()< 20)  width= "250px";
    else if (_title.length()< 25)  width= "300px";
    else                          width= "350px";

    formatter.setWidth(0, TITLE_POS, width);
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:14,代碼來源:DownloadGroupPanel.java

示例12: makeFaddedHelp

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public static HTML makeFaddedHelp(String s) {
    FireflyCss ffCss = CssData.Creator.getInstance().getFireflyCss();
    HTML desc = new HTML(s);
    desc.addStyleName("field-desc");
    desc.addStyleName(ffCss.fadedText());
    return desc;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:8,代碼來源:GwtUtil.java

示例13: XYPlotBasicWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public XYPlotBasicWidget(XYPlotMeta meta) {
        super(300,180);
//        super(300, 180);
        _meta = meta;
        GChart.setCanvasFactory(ChartingFactory.getInstance());
        _popoutWidgetSet = false;

        _actionHelp = new HTML();
        _actionHelp.setWidth("100%");
        _actionHelp.addStyleName(_ffCss.fadedText());

        /**
        final CheckBox outOfBoundCheck = GwtUtil.makeCheckBox("Connect Out of Bounds Points",
                "Take into account out of bounds points that are reasonably close", false);
        outOfBoundCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            public void onValueChange(ValueChangeEvent valueChangeEvent) {
                if (_chart != null && _data != null) {
                    preserveOutOfBoundPoints = outOfBoundCheck.getValue();
                    if (preserveOutOfBoundPoints) {
                        _chart.getYAxis().setOutOfBoundsMultiplier(Double.NaN);
                        _chart.getY2Axis().setAxisMin(_chart.getY2Axis().getAxisMin());
                        _chart.update();
                    } else {
                        _chart.getYAxis().setOutOfBoundsMultiplier(0);
                        _chart.getY2Axis().setAxisMin(_chart.getY2Axis().getAxisMin());
                        _chart.update();
                    }
                }
            }
        });
         */

    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:35,代碼來源:XYPlotBasicWidget.java

示例14: initReportSection

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的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

示例15: createSelectable

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
/**
 * Generate selectable widget text
 */
public static HTML createSelectable(String html) {
	HTML widget = new HTML(html);
	widget.addStyleName("okm-EnableSelect");
	return widget;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:9,代碼來源:Util.java


注:本文中的com.google.gwt.user.client.ui.HTML.addStyleName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。