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


Java Grid.getWidget方法代码示例

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


在下文中一共展示了Grid.getWidget方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getValue

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private static String getValue(FormPanel formPanel) {
	String value = null;
	
       if (formPanel instanceof HasWidgets) {
           HasWidgets hasWidgets = formPanel;
           Iterator<Widget> itr = hasWidgets.iterator();
           while (itr.hasNext()) {
               Widget widget = itr.next();
               if (widget instanceof Grid) {
                   Grid gridPanel = (Grid) widget;
                   FileUpload fileUpload = (FileUpload) gridPanel.getWidget(0, 0);
                   value = DOM.getElementAttribute(fileUpload.getElement(), "fu-uuid");
                   handleSimpleValue(formPanel, value);
               }
           }
       }
       
       return value;
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:20,代码来源:BuiltinHandlerHelper.java

示例2: createSubmitCompleteHandler

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public static SubmitCompleteHandler createSubmitCompleteHandler(final UIObject ui, final EventListenerGVO ev, final List<InputVariableGVO> inputVariables) {
	SubmitCompleteHandler submitCompleteHandler = new SubmitCompleteHandler() {
		public void onSubmitComplete(SubmitCompleteEvent event) {
			String uuId = event.getResults();
			boolean success = false;
			if ((uuId != null) && (uuId.indexOf("=") > 0)) {
				uuId = uuId.substring(uuId.indexOf("=") + 1);
				success = true;
			}
			FormPanel fp = (FormPanel) ui;
			if (fp instanceof HasWidgets) {
				HasWidgets hasWidgets = (HasWidgets) fp;
				Iterator<Widget> itr = hasWidgets.iterator();
				while (itr.hasNext()) {
					Widget widget = itr.next();
					if (widget instanceof Grid) {
						Grid gridPanel = (Grid) widget;
						FileUpload fileUpload = (FileUpload) gridPanel.getWidget(0, 0);
						if (success) {
							DOM.setElementAttribute(fileUpload.getElement(), "fu-uuid", uuId);
							CallbackHandler.createCallBack(ui, QAMLConstants.EVENT_ONFINISH, ev, inputVariables);
						} else {
							Label fileNameLabel = new Label("Uploading unsuccessfull.");// (Hyperlink)
																						// gridPanel.getWidget(1,
																						// 0);
							fileNameLabel.setText("Uploading unsuccessfull.");
							fileNameLabel.setVisible(true);
							gridPanel.add(fileNameLabel);
						}
					}
				}
			}
		}
	};
	return submitCompleteHandler;
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:37,代码来源:EventFactory.java

示例3: addDialogWidgets

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
	DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
	Button cancelButton = new Button("Cancel");
	
	recentlyViewedPanel.getHeader().addStyleName("dialog-label");
	recentlyViewedPanel.add(recentlyViewTable);
	
	recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
	recentlyCreatedPanel.add(recentlyCreatedTable);
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			if(currentTerm != null) {
				eventBus.fireEvent(new ViewTermEvent(currentTerm));
			}
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeDropBox);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}
			
	buttonsHPanel.add(addButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(recentlyViewedPanel);
	vertPanel.add(recentlyCreatedPanel);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:58,代码来源:AddRelationshipPopup.java

示例4: addDialogWidgets

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label commentsLabel = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");
	replacementLabel.addStyleName("dialog-label");
	commentsLabel.addStyleName("dialog-label");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			relationship = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeLabel);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(replacementLabel);
	vertPanel.add(table);
	vertPanel.add(commentsLabel);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:61,代码来源:ReplaceRelationshipPopup.java

示例5: addDialogWidgets

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(3,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
	DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
	Label comments = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	comments.addStyleName("dialog-label");
	
	recentlyViewedPanel.getHeader().addStyleName("dialog-label");
	recentlyViewedPanel.add(recentlyViewTable);
	
	recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
	recentlyCreatedPanel.add(recentlyCreatedTable);
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			obsoleteTerm = null;
			commentsField.setValue(null);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Replaced By:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, replaceByTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(recentlyViewedPanel);
	vertPanel.add(recentlyCreatedPanel);
	vertPanel.add(comments);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:60,代码来源:ReplaceTermPopup.java

示例6: addDialogWidgets

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
   	Grid grid = new Grid(5,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label comments = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");		
	comments.addStyleName("dialog-label");
							
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			synonym = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, ontologyHeadingLabel);
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Synonym:"));
	grid.setWidget(++row, col, new Label("Source:"));
	grid.setWidget(++row, col, new Label("Reference Id:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, synonymLabel);
	grid.setWidget(++row, col, sourceLabel);
	grid.setWidget(++row, col, referenceIdLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(comments);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:61,代码来源:ReplaceSynonymPopup.java

示例7: addDialogWidgets

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeDropBox);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}
	
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:43,代码来源:EditRelationshipPopup.java

示例8: setValue

import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public void setValue(int row,
                     String labelText,
                     String valueText,
                     String valueStyle,
                     boolean valueIsHtml,
                     boolean setOnlyIfActive) {
    int rowMin= 1;
    final int rowFinal= row;
    if (wide) {
        row--;
        rowMin= 0;
    }
    int labelIdx = 0;
    int valueIdx = labelIdx + 1;
    int gridRowCount= _grid.getRowCount() + (wide? gridWide.getRowCount():0);

    if (gridRowCount > row) {

        Grid workingGrid= _grid;
        int workingRow= row;
        if (wide && row>=WIDE_MAX_ROWS) {
            workingGrid= gridWide;
            workingRow= row-WIDE_MAX_ROWS;
            if ((gridRowCount-WIDE_MAX_ROWS) < (WIDE_MAX_ROWS)) workingRow++;
        }


        Label label = (Label) workingGrid.getWidget(workingRow, labelIdx);
        Label value = (Label) workingGrid.getWidget(workingRow, valueIdx);

        if (workingRow>=rowMin && label == null) {
            label = new Label(labelText);
            label.addStyleName("readout-label");
            workingGrid.setWidget(workingRow, labelIdx, label);

            List<Integer> rowWithOps= incrementAll(_currentHandler.getRowsWithOptions());
            if (rowWithOps!=null && rowWithOps.contains(row)) {
                GwtUtil.makeIntoLinkButton(label);
                label.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        showRowOps(rowFinal);
                    }
                });
            }
        }

        if (value == null) {
            value = new Label(valueText);
            value.addStyleName("readout-value");
            workingGrid.setWidget(workingRow, valueIdx, value);
        }


        label.setText(labelText);
        if (valueIsHtml) {
            DOM.setInnerHTML(value.getElement(), valueText);
        } else {
            value.setText(valueText);
        }

        String oldStyle = _styleMap.get(value);
        if (oldStyle != null) value.removeStyleName(oldStyle);
        if (valueStyle != null) {
            value.addStyleName(valueStyle);
            _styleMap.put(value, valueStyle);
        }
    }

}
 
开发者ID:lsst,项目名称:firefly,代码行数:70,代码来源:WebMouseReadout.java


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