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


Java Grid.setText方法代碼示例

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


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

示例1: createPanel

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private Panel createPanel() {
	Label label = new Label("Search Options");
	label.addStyleName("search-header");
	label.getElement().getStyle().setDisplay(Display.BLOCK);
	
	Grid grid = new Grid(2,2);
	grid.setText(0, 0, "Ontology/Codelist:");
	grid.setWidget(0, 1, ontologiesDropBox);
	grid.setText(1, 0, "Include Synonyms:");
	grid.setWidget(1, 1, includeSynonyms);
	grid.addStyleName("search-options");
	
	CellFormatter cellFormatter = grid.getCellFormatter();
	for(int i = 0; i < grid.getRowCount(); i++) {
		cellFormatter.addStyleName(i, 0, "search-option");
	}
	
	Panel panel = new FlowPanel();
	panel.add(label);
	panel.add(grid);
    return panel;
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:23,代碼來源:SearchOptionsView.java

示例2: createView

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void createView() {
	leftButton = new Button( getLeftButtonName() );
	rightButton = new Button( getRightButtonName() );

	Grid grid = new Grid( 2, 2 );
	grid.setText( 0, 0, "Name :" );
	grid.setWidget( 0, 1, createAndGetNameWidget() );

	HorizontalPanel buttons = new HorizontalPanel();
	buttons.add( leftButton );
	buttons.add( rightButton );

	grid.setWidget( 1, 1, buttons );

	setWidget( grid );
}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:17,代碼來源:AbstractProductView.java

示例3: createView

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void createView() {
	selectButton = new Button( "Select Name");
	leftButton = new Button( getLeftButtonName() );
	rightButton = new Button( getRightButtonName() );

	Grid grid = new Grid( 2, 2 );
	grid.setText( 0, 0, "Name :" );
	grid.setWidget( 0, 1, createAndGetNameWidget() );

	HorizontalPanel buttons = new HorizontalPanel();
	buttons.add( selectButton );
	buttons.add( leftButton );
	buttons.add( rightButton );

	grid.setWidget( 1, 1, buttons );

	initWidget( grid );
}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:19,代碼來源:AbstractCompanyView.java

示例4: UserCreateView

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

		id = new Label();
		lastName = new TextBox();
		firstName = new TextBox();

		Grid grid = new Grid( 3, 2 );
		grid.setText( 0, 0, "Last Name: " );
		grid.setText( 1, 0, "First Name: " );
		grid.setWidget( 0, 1, lastName );
		grid.setWidget( 1, 1, firstName );

		create = new Button( "Create" );

		VerticalPanel mainPanel = new VerticalPanel();
		mainPanel.add( grid );
		mainPanel.add( create );

		initWidget( mainPanel );
	}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:21,代碼來源:UserCreateView.java

示例5: UserDisplayView

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

		id = new Label();
		lastName = new Label();
		firstName = new Label();

		Grid grid = new Grid( 3, 2 );
		grid.setText( 0, 0, "Last Name: " );
		grid.setText( 1, 0, "First Name: " );
		grid.setText( 2, 0, "Generated Id: " );
		grid.setWidget( 0, 1, lastName );
		grid.setWidget( 1, 1, firstName );
		grid.setWidget( 2, 1, id );

		create = new Button( "New" );

		VerticalPanel mainPanel = new VerticalPanel();
		mainPanel.add( grid );
		mainPanel.add( create );

		initWidget( mainPanel );
	}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:23,代碼來源:UserDisplayView.java

示例6: setPlayerList

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void setPlayerList(List<PacketMatchingPlayer> players) {
	final Grid grid = new Grid(players.size(), 3);
	grid.addStyleName("gridFrame");
	grid.addStyleName("gridFontNormal");

	for (int row = 0; row < players.size(); ++row) {
		final PacketMatchingPlayer player = players.get(row);
		final Image image = new Image(Constant.ICON_URL_PREFIX + player.imageFileName);
		image.setPixelSize(Constant.ICON_SIZE, Constant.ICON_SIZE);

		grid.setWidget(row, 0, image);
		grid.setHTML(row, 1, player.playerSummary.asSafeHtml());
		grid.setText(row, 2, player.greeting);
	}

	panelGrid.setWidget(grid);
}
 
開發者ID:nodchip,項目名稱:QMAClone,代碼行數:18,代碼來源:PanelReadyForGame.java

示例7: LoadingMessagePopupPanel

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
@Inject
public LoadingMessagePopupPanel(Messages messages, Asset asset) {
	final Image ajaxImage = new Image(asset.loadingIcon());
	final Grid grid = new Grid(1, 3);
	grid.setWidget(0, 0, ajaxImage);
	grid.setText(0, 2, messages.loadingMessage_message());
	this.container.add(grid);
	add(this.container);
}
 
開發者ID:interseroh,項目名稱:demo-gwt-springboot,代碼行數:10,代碼來源:LoadingMessagePopupPanel.java

示例8: BallotWidget

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public BallotWidget(BallotSheetView bsv, EasyVoteAsyncCallback<Void> cb) {
	electionInfo = new VerticalPanel();
	this.add(electionInfo);
	
	electionIdLabel = new Label("Election id: " + bsv.getElectionId());
	electionInfo.add(electionIdLabel);
	
	electionQuestion = new Label(bsv.getQuestion());
	this.add(electionQuestion);
	
	squares = new ArrayList<RadioButton>();
	callback = cb;
	List<CandidateView> candidateList = bsv.getCandidates();
	
	optionsTable = new Grid(candidateList.size()+1, 2);
	optionsTable.addStyleName("BallotWidget-optionsTable");
	for (int i = 0; i < candidateList.size(); i++) {
		optionsTable.getCellFormatter().addStyleName(i, 0, "BallotWidget-optionsTableCells");
		optionsTable.getCellFormatter().addStyleName(i, 1, "BallotWidget-optionsTableCells");
		optionsTable.getCellFormatter().setHorizontalAlignment(i, 1, HasHorizontalAlignment.ALIGN_CENTER);
		
		optionsTable.setText(i, 0, candidateList.get(i).getName());
		RadioButton button = new RadioButton("candidates");
		squares.add(button);
		optionsTable.setWidget(i, 1, button);
	}
	this.add(optionsTable);
	
	submitVoteButton = new Button("Submit Vote");
	submitVoteButton.addStyleName("BallotWidget-submitVoteButton");
	submitVoteButton.addClickHandler(new SubmitHandler());
	this.add(submitVoteButton);
	
	submitBlankVoteButton = new Button("Submit Blank Vote");
	submitBlankVoteButton.addStyleName("BallotWidget-submitVoteButton");
	submitBlankVoteButton.addClickHandler(new SubmitBlankHandler());
	this.add(submitBlankVoteButton);
	
	this.addStyleName("easyvote-BallotWidget");
}
 
開發者ID:nmldiegues,項目名稱:easy-vote,代碼行數:41,代碼來源:BallotWidget.java

示例9: KeyHelpPopup

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public KeyHelpPopup() {
  super(true /* autohide */, true /* modal */);
  setStyleName(KeyResources.I.css().helpPopup());

  final Anchor closer = new Anchor(KeyConstants.I.closeButton());
  closer.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          hide();
        }
      });

  final Grid header = new Grid(1, 3);
  header.setStyleName(KeyResources.I.css().helpHeader());
  header.setText(0, 0, KeyConstants.I.keyboardShortcuts());
  header.setWidget(0, 2, closer);

  final CellFormatter fmt = header.getCellFormatter();
  fmt.addStyleName(0, 1, KeyResources.I.css().helpHeaderGlue());
  fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);

  final Grid lists = new Grid(0, 7);
  lists.setStyleName(KeyResources.I.css().helpTable());
  populate(lists);
  lists.getCellFormatter().addStyleName(0, 3, KeyResources.I.css().helpTableGlue());

  final FlowPanel body = new FlowPanel();
  body.add(header);
  body.getElement().appendChild(DOM.createElement("hr"));
  body.add(lists);

  focus = new FocusPanel(body);
  focus.getElement().getStyle().setProperty("outline", "0px");
  focus.getElement().setAttribute("hideFocus", "true");
  focus.addKeyPressHandler(this);
  focus.addKeyDownHandler(this);
  add(focus);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:40,代碼來源:KeyHelpPopup.java

示例10: formatGroup

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private int formatGroup(Grid lists, int row, int col, KeyCommandSet set) {
  if (set.isEmpty()) {
    return row;
  }

  if (lists.getRowCount() < row + 1) {
    lists.resizeRows(row + 1);
  }
  lists.setText(row, col + 2, set.getName());
  lists.getCellFormatter().addStyleName(row, col + 2, KeyResources.I.css().helpGroup());
  row++;

  return formatKeys(lists, row, col, set, null);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:15,代碼來源:KeyHelpPopup.java

示例11: addGrid

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private void addGrid(VerticalPanel fp) {
  grid = new Grid(2, 3);
  grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
  grid.setText(0, 0, AdminConstants.I.columnProjectName() + ":");
  grid.setWidget(0, 1, project);
  grid.setText(1, 0, AdminConstants.I.headingParentProjectName() + ":");
  grid.setWidget(1, 1, parent);
  grid.setWidget(1, 2, browse);
  fp.add(grid);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:11,代碼來源:CreateProjectScreen.java

示例12: setProjectType

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void setProjectType(final ProjectModelType type) {

	final Grid iconGrid = new Grid(1, 2);
	iconGrid.setCellPadding(0);
	iconGrid.setCellSpacing(0);

	iconGrid.setWidget(0, 0, FundingIconProvider.getProjectTypeIcon(type, IconSize.MEDIUM).createImage());
	DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 0), "paddingTop", "2px");
	iconGrid.setText(0, 1, ProjectModelType.getName(type));
	DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 1), "paddingLeft", "5px");

	projectTypeField.setValue(iconGrid.getElement().getString());
}
 
開發者ID:sigmah-dev,項目名稱:sigmah,代碼行數:18,代碼來源:LinkedProjectView.java

示例13: gridAdd

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private void gridAdd(Grid grid, String label, Widget widget, String styleName) {
	row++;
	grid.getCellFormatter().setStyleName(row, 0, "rdn-ColumnShort");
	grid.setText(row, 0, label);
	if (widget != null)
	{
		grid.setWidget(row, 1, widget);
		if (styleName != null)
			widget.setStyleName(styleName);
	}
}
 
開發者ID:Rise-Vision,項目名稱:rva,代碼行數:12,代碼來源:ScheduleItemManageWidget.java

示例14: setPlayerList

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void setPlayerList(List<PacketResult> result) {
	panelTransition.setVisible(true);

	grid = new Grid(result.size() + 1, 5);
	grid.addStyleName("gridFrame");
	grid.addStyleName("gridFontNormal");
	grid.setText(0, 1, "プレイヤー名");
	grid.setText(0, 2, "得點");
	grid.setText(0, 3, "順位");
	grid.setText(0, 4, "レーティング");

	for (int i = 0; i < result.size(); ++i) {
		PacketResult player = result.get(i);
		Image image = new Image(Constant.ICON_URL_PREFIX + player.imageFileName);
		image.setPixelSize(Constant.ICON_SIZE, Constant.ICON_SIZE);
		int row = i + 1;
		grid.setWidget(row, 0, image);
		grid.setHTML(row, 1, player.playerSummary.asResultSafeHtml());
		grid.setText(row, 2, player.score + "點");
		grid.setText(row, 3, player.rank + "位");

		int newRating = player.newRating;
		if (newRating <= 0) {
			continue;
		}

		SafeHtml ratingChange;
		int oldRating = player.playerSummary.rating;
		if (oldRating < newRating) {
			ratingChange = TEMPLATE.up(oldRating, newRating);
		} else if (oldRating == newRating) {
			ratingChange = TEMPLATE.equal(oldRating, newRating);
		} else {
			ratingChange = TEMPLATE.down(oldRating, newRating);
		}
		grid.setHTML(row, 4, ratingChange.asString());
	}

	panelPlayer.add(grid);
}
 
開發者ID:nodchip,項目名稱:QMAClone,代碼行數:41,代碼來源:PanelResult.java

示例15: setFeature

import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
@Override
public void setFeature(Feature feature) {
	// Clear the current panel:
	contentPanel.clear();

	// Layout the attributes of the feature in a grid:
	Grid grid = new Grid(feature.getLayer().getAttributeDescriptors().size(), 3);
	CellFormatter formatter = grid.getCellFormatter();
	int i = 0;
	for (AttributeDescriptor descriptor : feature.getLayer().getAttributeDescriptors()) {
		// Put the attribute label in the first column:
		grid.setText(i, 0, getAttributeLabel(feature, descriptor));
		formatter.getElement(i, 0).addClassName(resource.css().attributeLabel());

		// Put a delimiter in the second column:
		grid.setText(i, 1, getDelimiter());

		// Create a widget for the attribute value and put it in the last column:
		Widget attributeWidget = ATTRIBUTE_FACTORY.createAttributeWidget(feature, descriptor);
		attributeWidget.getElement().addClassName(resource.css().attributeValue());
		grid.setWidget(i, 2, attributeWidget);

		i++;
	}

	contentPanel.add(grid);
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt2,代碼行數:28,代碼來源:FeatureInfoViewImpl.java


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