本文整理汇总了Java中com.google.gwt.user.client.ui.HasWidgets.add方法的典型用法代码示例。如果您正苦于以下问题:Java HasWidgets.add方法的具体用法?Java HasWidgets.add怎么用?Java HasWidgets.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HasWidgets
的用法示例。
在下文中一共展示了HasWidgets.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installViews
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void installViews(List<HasWidgets> placeholders) {
setResponseFromElement(multiViewElements.get(0));
maxSelections = XMLUtils.getAttributeAsInt(multiViewElements.get(0), "maxSelections");
for (int i = 0; i < multiViewElements.size(); i++) {
Element element = multiViewElements.get(i);
SelectableChoicePresenter selectableChoice = createSelectableChoiceFromElement(element);
addClickHandler(selectableChoice);
HasWidgets currPlaceholder = placeholders.get(i);
currPlaceholder.add(selectableChoice.getView());
choicesManager.addChoice(selectableChoice);
}
}
示例2: createSingleViewModule
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void createSingleViewModule(Element element, HasWidgets parent, BodyGeneratorSocket bodyGeneratorSocket) {
IModule module = registry.createModule(element);
parenthood.addChild(module);
registerModuleFeedbacks(module, element);
if (module instanceof ISingleViewWithBodyModule) {
parenthood.pushParent((ISingleViewWithBodyModule) module);
((ISingleViewWithBodyModule) module).initModule(element, moduleSocket, bodyGeneratorSocket, eventsBus);
parenthood.popParent();
} else if (module instanceof ISingleViewSimpleModule) {
((ISingleViewSimpleModule) module).initModule(element, moduleSocket, eventsBus);
} else if (module instanceof IInlineModule) {
((IInlineModule) module).initModule(element, moduleSocket, eventsBus);
}
if (((ISingleViewModule) module).getView() instanceof Widget) {
parent.add(((ISingleViewModule) module).getView());
}
singleViewModules.add(module);
}
示例3: Application
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
public Application(final HasWidgets gwtFrame) {
// Build the application scaffolding; Header, Footer, Accordion
// and content presenter panel
// Fill the entire browser window with the application
injector.getApplicationPresenter().setInjector(injector);
gwtFrame.add(injector.getApplicationPresenter().getView());
// Instance both the WF Listing, WF Definition, Graphviz and Simulator
// presenters so that they can send/receive events between each other
injector.getWorkflowsPresenter();
injector.getWfDefinitionPresenter();
injector.getGraphvizPresenter();
injector.getSimulatorPresenter();
// Start with the Workflow listings content
injector.getEventBus().fireEvent(new SwitchToPresenterEvent("workflows.section"));
}
示例4: go
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void go(HasWidgets hasWidgets) {
hasWidgets.add(getWordView().asWidget());
context.getPlatformBus().addHandler(OpenFileEvent.TYPE, new OpenFileEvent.OpenFileHandler(){
@Override
public void onOpenFile(OpenFileEvent event) {
FileModel model=event.getModel();
if(!model.isFolder()){
open(model.getId(), null);
if(model.getOwner().equals(context.getUser().getUid())){
History.newItem(new PlacePath().toApp(App.Document)
.toDocType(DocType.MyDoc)
.toDocId(model.getId()).create().getToken(), false);
}else{
History.newItem(new PlacePath().toApp(App.Document)
.toDocType(DocType.SharedDoc)
.toDocId(model.getId())
.create().getToken(), false);
}
}
}
});
}
示例5: getPresenter
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public Presenter getPresenter() {
return new Presenter() {
public void go(HasWidgets hasWidgets) {
hasWidgets.add(widget);
String id=GWTEnvironment.getHomeTemplateId();
RPCS.getFileManagerService().getHomeFile(id, new AbstractAsyncCallback<FileModel>() {
public void onSuccess(FileModel result) {
widget.setContent(result.getContent());
}
@Override
public void onFailure(Throwable caught) {
TemplateResources templates=GWT.create(TemplateResources.class);
widget.setContent(templates.home().getText());
}
});
}
@Override
public PlatformContext getPlatformContext() {
return null;
}
};
}
示例6: addCustomPanelOnContainer
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
private CustomPanelDefinition addCustomPanelOnContainer(final Object container,
CustomPanelDefinitionImpl panelDef) {
final WorkbenchPanelPresenter panelPresenter = beanFactory.newWorkbenchPanel(panelDef);
Widget panelViewWidget = panelPresenter.getPanelView().asWidget();
panelViewWidget.addAttachHandler(new CustomPanelCleanupHandler(panelPresenter));
if (container instanceof HasWidgets) {
HasWidgets widgetContainer = (HasWidgets) container;
widgetContainer.add(panelViewWidget);
customPanels.put(panelDef,
widgetContainer);
} else {
HTMLElement htmlContainer = (HTMLElement) container;
appendWidgetToElement(htmlContainer,
panelViewWidget);
customPanelsInsideHTMLElements.put(panelDef,
htmlContainer);
}
mapPanelDefinitionToPresenter.put(panelDef,
panelPresenter);
onPanelFocus(panelDef);
return panelDef;
}
示例7: addWidgetTo
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
public static void addWidgetTo(Widget aWidet, HasWidgets aContainer) {
if (aContainer != null) {
aWidet.setVisible(true);
aContainer.clear();
if (aContainer instanceof BorderPane) {
((BorderPane) aContainer).add(aWidet);
} else if (aContainer instanceof MarginsPane) {
MarginConstraints mc = new MarginConstraints();
mc.setTop(new Margin(0, Style.Unit.PX));
mc.setBottom(new Margin(0, Style.Unit.PX));
mc.setLeft(new Margin(0, Style.Unit.PX));
mc.setRight(new Margin(0, Style.Unit.PX));
((MarginsPane) aContainer).add(aWidet, mc);
} else if (aContainer instanceof SplitPane) {
((SplitPane) aContainer).setFirstWidget(aWidet);
} else if (aContainer instanceof RootPanel) {
aContainer.add(aWidet);
} else {
aContainer.add(aWidet);
}
}
}
示例8: renderLayout
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
protected UIObject renderLayout(PanelGVO panelGVO, AbsoluteLayoutGVO layoutGVO, String owner, String uuid, String parent, String context, AbstractActivity activity) {
HasWidgets panel = createPanel();
ElementGVO[] elements = layoutGVO.getElements();
if ((elements != null) && (elements.length > 0)) {
ScrollPanel scrollPanel = createScrollPanel();
panel.add(scrollPanel);
QLayoutAbsolute layout = new QLayoutAbsolute();
for (ElementGVO elementGVO : elements) {
UIObject child = renderChildComponent(elementGVO.getComponent(), owner, uuid, parent, context, activity);
if (child instanceof Widget) {
int posX = elementGVO.getX();
int posY = elementGVO.getY();
layout.add((Widget)child, posX, posY);
}
}
scrollPanel.setWidget(layout);
scrollPanel.refresh();
}
return (UIObject)panel;
}
示例9: getPresenter
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public Presenter getPresenter() {
return new Presenter() {
public void go(HasWidgets hasWidgets) {
hasWidgets.add(widget);
String id=GWTEnvironment.getHomeTemplateId();
RPCS.getFileManagerService().getFile(id, new AbstractAsyncCallback<FileModel>() {
public void onSuccess(FileModel result) {
widget.setContent(result.getContent());
}
@Override
public void onFailure(Throwable caught) {
TemplateResources templates=GWT.create(TemplateResources.class);
widget.setContent(templates.home().getText());
}
});
}
@Override
public PlatformContext getPlatformContext() {
return null;
}
};
}
示例10: attachMediaScreenToFullscreenTemplate
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
private void attachMediaScreenToFullscreenTemplate(Widget parent) {
Widget parentWrapper = parent.getParent();
if (parentWrapper instanceof HasWidgets) {
HasWidgets parentPanel = (HasWidgets) parentWrapper;
parentPanel.add(getMediaObject());
}
}
示例11: go
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void go(final HasWidgets container) {
bind();
container.clear();
container.add(view.asWidget());
init();
}
示例12: go
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void go(HasWidgets container) {
bind();
container.clear();
container.add(accountView.asWidget());
init();
}
示例13: apply
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
/**
* Apply the scaffolding together.
* @param container the base container for the scaffolding.
*/
protected void apply(HasWidgets container) {
container.clear();
container.add(topPanel);
container.add(tableBody);
topPanel.add(infoPanel);
topPanel.add(toolPanel);
tableBody.add(table);
table.addHead(new MaterialWidget(DOM.createElement("thead")));
table.addBody(new MaterialWidget(DOM.createElement("tbody")));
}
示例14: setRoot
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void setRoot(PerspectiveActivity activity,
PanelDefinition root) {
checkNotNull("root",
root);
final WorkbenchPanelPresenter oldRootPanelPresenter = mapPanelDefinitionToPresenter.remove(rootPanelDef);
if (!mapPanelDefinitionToPresenter.isEmpty()) {
String message = "Can't replace current root panel because it is not empty. The following panels remain: " + mapPanelDefinitionToPresenter;
mapPanelDefinitionToPresenter.put(rootPanelDef,
oldRootPanelPresenter);
throw new IllegalStateException(message);
}
HasWidgets perspectiveContainer = layoutSelection.get().getPerspectiveContainer();
perspectiveContainer.clear();
getBeanFactory().destroy(oldRootPanelPresenter);
this.rootPanelDef = root;
WorkbenchPanelPresenter newPresenter = mapPanelDefinitionToPresenter.get(root);
if (newPresenter == null) {
newPresenter = getBeanFactory().newRootPanel(activity,
root);
mapPanelDefinitionToPresenter.put(root,
newPresenter);
}
perspectiveContainer.add(newPresenter.getPanelView().asWidget());
}
示例15: go
import com.google.gwt.user.client.ui.HasWidgets; //导入方法依赖的package包/类
@Override
public void go(HasWidgets container) {
container.clear();
container.add(m_view.asWidget());
m_restService.getInterfaceList();
}