Java 类com.google.gwt.user.client.ui.Composite 实例源码

项目:blogwt    文件:NavigationController.java   
private void attachPage (PageType type,
        final NavigationChangedEvent event) {
    Composite page = null;

    if ((page = getPageFromCache(type)) == null) {
        createAsyncPage(type, event);
    }

    if (page != null) {
        if (!page.isAttached()) {
            pageHolder.clear();
            pageHolder.add(page);
        }

        Scheduler.get().scheduleDeferred( () -> DefaultEventBus.get()
                .fireEventFromSource(event, NavigationController.this));
    }
}
项目:appformer    文件:Layouts.java   
private static void getContainedHierarchyRecursively(final Widget startAt,
                                                     int depth,
                                                     IndentedLineAccumulator result) {
    if (startAt == null) {
        result.append(depth,
                      "(null)");
        return;
    }
    result.append(depth,
                  widgetInfo(startAt));
    if (startAt instanceof HasWidgets) {
        for (Widget child : ((HasWidgets) startAt)) {
            getContainedHierarchyRecursively(child,
                                             depth + 1,
                                             result);
        }
    } else if (startAt instanceof Composite) {
        getContainedHierarchyRecursively(extractWidget(((Composite) startAt)),
                                         depth + 1,
                                         result);
    }
}
项目:gwtmockito    文件:GwtMockitoTest.java   
@Test
public void shouldCallNativeMethodsWithoutFailures() throws Exception {
  class SomeComposite extends Composite {
    public SomeComposite() {
      // initWidget relies on native calls
      initWidget(mock(Widget.class));
    }
    private native boolean runNativeMethod() /*-{
      return true;
    }-*/;
  }

  // Note that the result will be false even though the native method should return true - we
  // can't run the actual javascript and have to return a default value
  assertFalse(new SomeComposite().runNativeMethod());
}
项目:ephesoft    文件:BatchClassManagementController.java   
/**
 * To craete view.
 * 
 * @return Composite
 */
@Override
public Composite createView() {
    this.view = new BatchClassManagementView(this.eventBus);
    this.batchClassManagementPresenter = new BatchClassManagementPresenter(this, view);
    return this.view;
}
项目:ephesoft    文件:BatchListController.java   
/**
 * To create View.
 * 
 * @return Composite
 */
@Override
public Composite createView() {
    this.view = new LandingView();
    this.view.buildLandingPage();
    this.batchListPresenter = new BatchListPresenter(this, view);
    return this.view;
}
项目:ephesoft    文件:CustomWorkflowController.java   
@Override
public Composite createView() {

    this.customWorkflowManagementView = new CustomWorkflowManagementView();
    this.customWorkflowManagementPresenter = new CustomWorkflowManagementPresenter(this, this.customWorkflowManagementView);

    return this.customWorkflowManagementView;
}
项目:ephesoft    文件:BatchInstanceController.java   
/**
 * To create View.
 */
@Override
public Composite createView() {
    this.batchInstanceView = new BatchInstanceView();
    this.batchInstancePresenter = new BatchInstancePresenter(this, batchInstanceView);
    return this.batchInstanceView;
}
项目:gerrit    文件:RelatedChanges.java   
private void initTabBar() {
  TabBar tabBar = getTabBar();
  tabBar.addSelectionHandler(
      new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
          if (selectedTab >= 0) {
            tabs.get(selectedTab).registerKeys(false);
          }
          selectedTab = event.getSelectedItem();
          tabs.get(selectedTab).registerKeys(true);
        }
      });

  for (Tab tabInfo : Tab.values()) {
    RelatedChangesTab panel = new RelatedChangesTab(tabInfo);
    add(panel, tabInfo.defaultTitle);
    tabs.add(panel);

    TabBar.Tab tab = tabBar.getTab(tabInfo.ordinal());
    tab.setWordWrap(false);
    ((Composite) tab).setTitle(tabInfo.tooltip);

    setTabEnabled(tabInfo, false);
  }
  getTab(Tab.RELATED_CHANGES).setShowIndirectAncestors(true);
  getTab(Tab.CHERRY_PICKS).setShowBranches(true);
  getTab(Tab.SAME_TOPIC).setShowBranches(true);
  getTab(Tab.SAME_TOPIC).setShowProjects(true);
  getTab(Tab.SAME_TOPIC).setShowSubmittable(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowBranches(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowProjects(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowSubmittable(true);
}
项目:putnami-web-toolkit    文件:Modal.java   
private Widget getContainerWidget() {
    if (containerWidget == null) {
        if (getParent() instanceof HasWidgets) {
            containerWidget = this;
        } else if (getParent() instanceof Composite) {
            containerWidget = getParent();
        }
    }
    return containerWidget;
}
项目:socom    文件:InfluenceAnswerTextView.java   
@Override
public void animate() {
    Animation a = new Animation() {
        @Override
        protected void onUpdate(double progress) {
            Composite c = InfluenceAnswerTextView.this;
            c.getElement().getStyle().setProperty("opacity", String.valueOf(progress));
        }
    };
    a.run(3000);
}
项目:socom    文件:InfluenceAnswerAudioView.java   
@Override
public void animate() {
    Animation a = new Animation() {
        @Override
        protected void onUpdate(double progress) {
            Composite c = InfluenceAnswerAudioView.this;
            c.getElement().getStyle().setProperty("opacity", String.valueOf(progress));
        }
    };
    a.run(3000);
}
项目:kie-wb-common    文件:WorkbenchConfigurationHandler.java   
/**
 * Return a List of Widgets that the NewWorkbenchConfigurationHandler can use to gather additional parameters for the
 * new workbench configuration. The List is of Pairs, where each Pair consists of a String caption and IsWidget editor.
 * @return null if no extension is provided
 */
public List<Pair<String, ? extends Composite>> getExtensions() {
    if ( widgetList == null || widgetList.size() == 0 ) {
        widgetList = new ArrayList<Pair<String, ? extends Composite>>();
    }
    return this.widgetList;
}
项目:kie-wb-common    文件:WorkbenchConfigurationHandler.java   
/**
 * get specific widget by using widget name
 * @param name : specific widget name
 * @return
 */
public Composite getWidgetByName( final String name ) {
    for ( Pair<String, ? extends Composite> pair : widgetList ) {
        if ( pair.getK1().equals( name ) ) {
            return pair.getK2();
        }
    }
    return null;
}
项目:kie-wb-common    文件:WorkbenchConfigurationViewImpl.java   
private void setup() {
    if ( activeHandler != null ) {
        view.clear();
        activeHandler.loadUserWorkbenchPreferences();
        for ( Pair<String, ? extends Composite> p : activeHandler.getExtensions() ) {
            view.add( p.getK2() );
        }
    }
}
项目:ephesoft    文件:ReportingController.java   
@Override
public Composite createView() {
    this.view = new ReportingView();
    this.reportingPresenter = new ReportingPresenter(this, view);
    return this.view;
}
项目:ephesoft    文件:FolderManagementController.java   
@Override
public Composite createView() {
    this.folderManagementView = new FolderManagementView();
    this.folderManagementPresenter = new FolderManagementPresenter(this, this.folderManagementView);
    return this.folderManagementView;
}
项目:ephesoft    文件:UploadBatchController.java   
@Override
public Composite createView() {
    this.uploadBatchView = new UploadBatchView();
    this.uploadBatchPresenter = new UploadBatchPresenter(this, uploadBatchView);
    return this.uploadBatchView;
}
项目:showcase    文件:CustomRoute.java   
public CustomRoute(String name, Composite layout) {
    super(name);
    layout_ = layout;
}
项目:blogwt    文件:NavigationController.java   
private Composite getPageFromCache (PageType type) {
    return pages.get(pageKeyForCache(type));
}
项目:gwt-sandbox    文件:sandbox.java   
public CustomRoute(String name, Composite layout) {
    super(name);
    layout_ = layout;
}
项目:gwtmockito    文件:GwtMockitoTestRunner.java   
/**
 * Returns a collection of classes whose non-abstract methods should always be replaced with
 * no-ops. By default, this list includes {@link Composite}, {@link DOM} {@link UIObject},
 * {@link Widget}, {@link Image}, and most subclasses of {@link Panel}. It will also include any
 * classes specified via the {@link WithClassesToStub} annotation on the test class. This makes
 * it much safer to test code that uses or extends these types.
 * <p>
 * This list can be customized via {@link WithClassesToStub} or by defining a new test runner
 * extending {@link GwtMockitoTestRunner} and overriding this method. This allows users to
 * explicitly stub out particular classes that are causing problems in tests. If you override this
 * method, you will probably want to retain the classes that are stubbed here by doing something
 * like this:
 *
 * <pre>
 * &#064;Override
 * protected Collection&lt;Class&lt;?&gt;&gt; getClassesToStub() {
 *   Collection&lt;Class&lt;?&gt;&gt; classes = super.getClassesToStub();
 *   classes.add(MyBaseWidget.class);
 *   return classes;
 * }
 * </pre>
 *
 * @return a collection of classes whose methods should be stubbed with no-ops while running tests
 */
protected Collection<Class<?>> getClassesToStub() {
  Collection<Class<?>> classes = new LinkedList<Class<?>>();
  classes.add(Composite.class);
  classes.add(DOM.class);
  classes.add(UIObject.class);
  classes.add(Widget.class);

  classes.add(DataGrid.class);
  classes.add(HTMLTable.class);
  classes.add(Image.class);

  classes.add(AbsolutePanel.class);
  classes.add(CellList.class);
  classes.add(CellPanel.class);
  classes.add(CellTable.class);
  classes.add(ComplexPanel.class);
  classes.add(DeckLayoutPanel.class);
  classes.add(DeckPanel.class);
  classes.add(DecoratorPanel.class);
  classes.add(DockLayoutPanel.class);
  classes.add(DockPanel.class);
  classes.add(FlowPanel.class);
  classes.add(FocusPanel.class);
  classes.add(HorizontalPanel.class);
  classes.add(HTMLPanel.class);
  classes.add(LayoutPanel.class);
  classes.add(Panel.class);
  classes.add(PopupPanel.class);
  classes.add(RenderablePanel.class);
  classes.add(ResizeLayoutPanel.class);
  classes.add(SimpleLayoutPanel.class);
  classes.add(SimplePanel.class);
  classes.add(SplitLayoutPanel.class);
  classes.add(StackPanel.class);
  classes.add(VerticalPanel.class);
  classes.add(ValueListBox.class);

  WithClassesToStub annotation = unitTestClass.getAnnotation(WithClassesToStub.class);
  if (annotation != null) {
    classes.addAll(Arrays.asList(annotation.value()));
  }

  return classes;
}
项目:gwtmockito    文件:GwtMockitoWidgetBaseClassesTest.java   
@Test
public void testUiObjects() throws Exception {
  invokeAllAccessibleMethods(new Widget() {});
  invokeAllAccessibleMethods(new UIObject() {});
  invokeAllAccessibleMethods(new Composite() {});
}
项目:ephesoft    文件:AdminEntryPoint.java   
/**
 * To get the main view.
 * 
 * @return Composite
 */
public abstract Composite getMainView();
项目:ephesoft    文件:Controller.java   
public abstract Composite createView();
项目:ephesoft    文件:AbstractController.java   
public abstract Composite createView();