當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。