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


Java HasWidgets类代码示例

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


HasWidgets类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasWidgets类的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);
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:IdentificationModule.java

示例2: installViews

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
@Override
public void installViews(List<HasWidgets> placeholders) {
    styles = styleSocket.getStyles(getModuleElement());

    setFontSize(styles);
    setDimensions(styles);
    setMaxlengthBinding(styles, getModuleElement());
    setWidthBinding(styles, getModuleElement());

    installViewPanel(placeholders.get(0));

    initReplacements(styles);
    parseInitialText();
    fillGapWithInitial();

}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:TextEntryGapModule.java

示例3: installViews

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
@Override
public void installViews(List<HasWidgets> placeholders) {
    HasWidgets placeholder = placeholders.get(0);
    presenter.installViewInContainer(((HasWidgets) ((Widget) placeholder).getParent()));

    String uid = getElementAttributeValue(EmpiriaTagConstants.ATTR_UID);
    mathGapModel.setUid(uid);

    Map<String, String> styles = styleSocket.getStyles(getModuleElement());
    mathGapModel.getMathStyles().putAll(styles);
    initParametersBasedOnMathStyles();

    setListBoxEmptyOption();
    options = createOptions(getModuleElement(), getModuleSocket());
    gapContainer.addMathGap(this);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:InlineChoiceMathGapModule.java

示例4: 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);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:23,代码来源:ModulesInstalator.java

示例5: installMultiViewNonuniuqeModules

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
public void installMultiViewNonuniuqeModules() {
    for (Element currElement : nonuniqueModulesMap.getKeys()) {
        StackMap<IModule, HasWidgets> moduleMap = nonuniqueModulesMap.get(currElement);
        IModule module = moduleMap.getKeys().get(0);

        if (module instanceof IMultiViewModule) {
            IMultiViewModule multiViewModule = (IMultiViewModule) module;
            List<HasWidgets> placeholders = moduleMap.getValues();

            multiViewModule.initModule(moduleSocket, eventsBus);
            multiViewModule.addElement(currElement);
            multiViewModule.installViews(placeholders);
            registerModuleFeedbacks(module, currElement);
        }
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:ModulesInstalator.java

示例6: processNode

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
@Override
public void processNode(Node node, HasWidgets parent) {
    if (ignoredTagNames != null && SECTION.equals(node.getNodeName())
            && ignoredTagNames.contains(((com.google.gwt.xml.client.Element) node).getAttribute("name"))) {

    } else if (ignoredTagNames != null && SECTION.equals(node.getNodeName()) && ignoredTagNames.contains("untagged") && !detectTagNode(node)) {

    } else if (SECTION.equals(node.getNodeName())) {
        generateBody(node, parent);
    } else if (node.getNodeType() == Node.COMMENT_NODE) {

    } else if (moduleInstalatorSocket != null && moduleInstalatorSocket.isModuleSupported(node.getNodeName())) {

        Element element = (Element) node;
        if (moduleInstalatorSocket.isMultiViewModule(element)) {
            moduleInstalatorSocket.registerModuleView(element, parent);
        } else {
            moduleInstalatorSocket.createSingleViewModule(element, parent, this);
        }
    }

}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:23,代码来源:BodyGenerator.java

示例7: 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"));
}
 
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:21,代码来源:Application.java

示例8: showContextMenuPopup

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
protected void showContextMenuPopup(int left, int top) {
    if (customContextMenu instanceof HasWidgets) {
        if (!((HasWidgets) customContextMenu).iterator().hasNext()) {
            // there are no actions to show
            return;
        }
    }

    customContextMenuPopup = Tools.createCubaTableContextMenu();
    customContextMenuPopup.setOwner(this);
    customContextMenuPopup.setWidget(customContextMenu);

    customContextMenuPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            customContextMenuPopup = null;
        }
    });

    Tools.showPopup(customContextMenuPopup, left, top);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:CubaTreeWidget.java

示例9: 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);
				}
			}
		}
	});
	
}
 
开发者ID:ctripcorp,项目名称:dataworks-zeus,代码行数:25,代码来源:WordPresenterImpl.java

示例10: 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;
		}
	};
}
 
开发者ID:ctripcorp,项目名称:dataworks-zeus,代码行数:24,代码来源:HomeApp.java

示例11: findHelpBlock

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
/**
 * Find the sibling {@link MaterialHelpBlock}.
 *
 * @param widget the {@link Widget} to search.
 * @return the found {@link MaterialHelpBlock} of null if not found.
 */
protected MaterialHelpBlock findHelpBlock(Widget widget) {
    if (widget != null) {
        if (widget instanceof MaterialHelpBlock) {
            return (MaterialHelpBlock) widget;
        }
        // Try and find the MaterialHelpBlock in the children of the given widget.
        if (widget instanceof HasWidgets) {
            for (Widget w : (HasWidgets) widget) {
                if (w instanceof MaterialHelpBlock) {
                    return (MaterialHelpBlock) w;
                }
            }
        }
        // Try and find the MaterialHelpBlock in the parent of widget.
        return findHelpBlock(widget.getParent());
    }
    return null;
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:25,代码来源:DefaultErrorHandler.java

示例12: checkActiveState

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
/**
 * Checks if this child holds the current active state.
 * If the child is or contains the active state it is applied.
 */
protected void checkActiveState(Widget child) {
    // Check if this widget has a valid href
    String href = child.getElement().getAttribute("href");
    String url = Window.Location.getHref();
    int pos = url.indexOf("#");
    String location = pos >= 0 ? url.substring(pos, url.length()) : "";

    if (!href.isEmpty() && location.startsWith(href)) {
        ListItem li = findListItemParent(child);
        if (li != null) {
            makeActive(li);
        }
    } else if (child instanceof HasWidgets) {
        // Recursive check
        for (Widget w : (HasWidgets) child) {
            checkActiveState(w);
        }
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:24,代码来源:MaterialCollapsibleBody.java

示例13: getFocusableChildren

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
/**
 * Lookup all nested children in widget and tries to search children which implement Focusable
 * interface.
 *
 * @param widget widget to lookup
 * @return list of {@link com.google.gwt.user.client.ui.Focusable} widgets or empty list if none
 *     was found
 * @see com.google.gwt.user.client.ui.Focusable
 */
public static List<FocusWidget> getFocusableChildren(Widget widget) {
  List<FocusWidget> focusable = new ArrayList<>();

  if (widget instanceof FocusWidget) {
    focusable.add((FocusWidget) widget);
  }

  if (widget instanceof HasWidgets) {
    for (Widget w : ((HasWidgets) widget)) {
      focusable.addAll(getFocusableChildren(w));
    }
  }

  return focusable;
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:UIUtil.java

示例14: addKeyPressToAll

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
private void addKeyPressToAll(Widget inWidget) {
    if (keyPressHandler != null && inWidget instanceof HasWidgets) {
        HasWidgets container = (HasWidgets) inWidget;
        for (Widget w : container) {
            if (w instanceof InputField) {
                InputField f = (InputField) w;
                if (f.getFocusWidget() != null) {
                    f.getFocusWidget().addKeyPressHandler(keyPressHandler);
                }
            } else if (w instanceof SimpleTargetPanel) {
                SimpleTargetPanel sp = (SimpleTargetPanel) w;
                if (sp.getInputField() != null && sp.getInputField().getFocusWidget() != null) {
                    sp.getInputField().getFocusWidget().addKeyPressHandler(keyPressHandler);
                }
            } else {
                addKeyPressToAll(w);
            }
        }
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:21,代码来源:CatalogPanel.java

示例15: handleShowHide

import com.google.gwt.user.client.ui.HasWidgets; //导入依赖的package包/类
private static void handleShowHide(Widget w, boolean doShow) {
    if (w == null) return;
    if (w instanceof VisibleListener) {
        if (doShow) {
            ((VisibleListener) w).onShow();
        } else {
            ((VisibleListener) w).onHide();
        }
    }
    if (w instanceof HasWidgets) {
        HasWidgets containers = (HasWidgets) w;
        for (Iterator<Widget> itr = containers.iterator(); itr.hasNext(); ) {
            handleShowHide(itr.next(), doShow);
        }
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:17,代码来源:GwtUtil.java


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