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


Java ActivityManager.setDisplay方法代码示例

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


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

示例1: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {

    ClientFactory clientFactory = GWT.create(ClientFactory.class);
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Start ActivityManager for the twitter widget with our ActivityMapper
    ActivityMapper activityMapper = new AppActivityMapper(clientFactory);
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(appWidget);

    // Start PlaceHistoryHandler with our PlaceHistoryMapper
    AppPlaceHistoryMapper historyMapper= GWT.create(AppPlaceHistoryMapper.class);
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    RootPanel.get().add(appWidget);
    // Goes to the place represented on URL else default place
    historyHandler.handleCurrentHistory();

}
 
开发者ID:WSDOT,项目名称:social-analytics,代码行数:23,代码来源:SocialAnalytics.java

示例2: initDigitalObjectEditor

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
private Canvas initDigitalObjectEditor(DigitalObjectEditor childEditor, SimpleEventBus eventBus) {
    childEditor.setImportView(true);
    RelationDataSource relationDataSource = RelationDataSource.getInstance();
    relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {

        @Override
        public void onRelationChange(RelationChangeEvent event) {
            // issue 262: isVisible seems to be always true and isAttached is always null.
            // Add test isDrawn that seems to change for dettached widgets.
            if (batchItemGrid.isVisible() && batchItemGrid.isDrawn()) {
                updateCache();
            }
        }
    });
    ActivityManager activityManager = new ActivityManager(
            new ChildActivities(childEditor), eventBus);

    VLayout editorsLayout = new VLayout();
    editorsLayout.addStyleName("defaultBorder");
    activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));
    return editorsLayout;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:23,代码来源:ImportBatchItemEditor.java

示例3: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
/**
 * This is the entry point method.
 */
public void onModuleLoad() {

	ClientFactory clientFactory = GWT.create(ClientFactory.class);
	EventBus eventBus = clientFactory.getEventBus();
	PlaceController placeController = clientFactory.getPlaceController();

	// Start ActivityManager for the main widget with our ActivityMapper
	ActivityMapper activityMapper = new AppMapper(clientFactory);
	ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
	activityManager.setDisplay(new SimplePanel());

	// Start PlaceHistoryHandler with our PlaceHistoryMapper
	AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);
	PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
	historyHandler.register(placeController, eventBus, defaultPlace);

	// Goes to the place represented on URL else default place
	historyHandler.handleCurrentHistory();
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:23,代码来源:Yaph.java

示例4: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
  ensureCssInjected();

  ManagerClientFactory clientFactory = new DefaultManagerClientFactoryImpl();

  EventBus eventBus = clientFactory.getEventBus();
  PlaceController placeController = clientFactory.getPlaceController();

  // Start ActivityManager for the main widget with our ActivityMapper
  ActivityMapper activityMapper = new ManagerActivityMapper(clientFactory);
  ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
  activityManager.setDisplay(clientFactory.getLayoutView());

  // Start PlaceHistoryHandler with our PlaceHistoryMapper
  ManagerPlaceHistoryMapper historyMapper= GWT.create(ManagerPlaceHistoryMapper.class);
  PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
  historyHandler.register(placeController, eventBus, defaultPlace);

  RootLayoutPanel.get().add(clientFactory.getLayoutView());

  historyHandler.handleCurrentHistory();
}
 
开发者ID:thorntonv,项目名称:mechaverse,代码行数:24,代码来源:MechaverseClient.java

示例5: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {

	GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
		public void onUncaughtException(Throwable e) {
			Log.log(Level.SEVERE, e.getMessage(), e);
			MaterialToast.fireToast("Unknown error, please reload application");
		}
	});

	Theme.bundle();	// inject

   	workPanel = new SimplePanel();
   	workPanel.setSize("100%", "100%");

	ActivityMapper activityMapper = new MentorActivityMapper();
	ActivityManager activityManager = new ActivityManager(activityMapper, MentorBus.get());
	activityManager.setDisplay(workPanel);

	Element loader = Document.get().getElementById("loader");
	if (loader != null)
		loader.removeFromParent();
	
	RootPanel.get().add(workPanel, 0, 0);

       Places.handler().handleCurrentHistory();	// goes to the place represented on URL, else default place

}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:29,代码来源:Mentor.java

示例6: OptionalEditor

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
private OptionalEditor(ClientMessages i18n, Layout previewContainer) {
    SimpleEventBus eventBus = new SimpleEventBus();
    embeddedPlaces = new PlaceController(eventBus);
    DigitalObjectEditor embeddedEditor = new DigitalObjectEditor(i18n, embeddedPlaces, true);
    embeddedEditor.setOptionalView(true);
    ActivityManager activityManager = new ActivityManager(
            new ChildActivities(embeddedEditor), eventBus);
    activityManager.setDisplay(new ChildEditorDisplay(previewContainer));
}
 
开发者ID:proarc,项目名称:proarc,代码行数:10,代码来源:DigitalObjectEditor.java

示例7: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
public void onModuleLoad() {
    AppInjector injector = GWT.create(AppInjector.class);
    PlaceHistoryHandler placeHistoryHandler = injector.getPlaceHistoryHandler();
    ActivityManager activityManager = injector.getActivityManager();

    SimplePanel panel = new SimplePanel();
    activityManager.setDisplay(panel);
    RootPanel.get().add(panel);

    placeHistoryHandler.handleCurrentHistory();
}
 
开发者ID:dharmab,项目名称:sheets,代码行数:12,代码来源:Sheets.java

示例8: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
    populateMenu();

    // Create view container
    final SimplePanel container = new SimplePanel();
    container.setStyleName("container requestor-showcase-container");
    RootPanel.get().add(container);

    // Main Factory (Dependency Injector)
    ShowcaseClientFactory clientFactory = CLIENT_FACTORY;
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Activity-Place binding
    ActivityMapper activityMapper = new ShowcaseActivityMapper();
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(container);

    // Place-History binding
    PlaceHistoryMapper historyMapper = new ShowcasePlaceHistoryMapper();
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    // Add Loading widget
    RootPanel.get().add(new Loading(eventBus));

    // Goes to place represented on URL or default place
    historyHandler.handleCurrentHistory();
}
 
开发者ID:reinert,项目名称:requestor,代码行数:31,代码来源:Showcase.java

示例9: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
    GWT.setUncaughtExceptionHandler(new DialogBoxUncaughtExceptionHandler());

    ApplicationRequestFactory requestFactory = GWT
            .create(ApplicationRequestFactory.class);
    Logger.getLogger("").addHandler(new SimpleRemoteLogHandler());

    ClientFactory clientFactory = GWT.create(ClientFactory.class);
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Start ActivityManager for the main widget with our ActivityMapper
    requestFactory.initialize(eventBus, new EventSourceRequestTransport(
            eventBus));
    ActivityMapper activityMapper = new AppActivityMapper(clientFactory,
            requestFactory);
    ActivityManager activityManager = new ActivityManager(activityMapper,
            eventBus);
    HasBody template = clientFactory.getTemplate();
    activityManager.setDisplay(template.getBody());

    // Start PlaceHistoryHandler with our PlaceHistoryMapper
    AppPlaceHistoryMapper historyMapper = GWT
            .create(AppPlaceHistoryMapper.class);
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(
            historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    RootLayoutPanel.get().add(template);
    // Goes to the place represented on URL else default place
    historyHandler.handleCurrentHistory();
}
 
开发者ID:apetrelli,项目名称:samplegwt,代码行数:34,代码来源:__moduleName__.java

示例10: loadApp

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
private void loadApp() {
    // Show login links
    Element userLinks = Document.get().getElementById(AppStyles.ID_USER_LINKS);
    UListElement ul = Document.get().createULElement();
    LIElement liSignedIn = Document.get().createLIElement();
    LIElement liSignOut = Document.get().createLIElement();
    User me = App.getAppModel().getMe();
    String firstName = me.firstName;
    String lastName = me.lastName;
    liSignedIn.setInnerHTML("Signed in as <span class=\"nameText\">" + firstName + " " + lastName + "</span>");
    liSignOut.setInnerHTML("<span class=\"listmaker-userEmail\">" + me.emailAddress + "</span>");
    liSignOut.setInnerHTML("<a href=\"" + LOGOUT_URL + "\">Sign out</a>");
    ul.appendChild(liSignedIn);
    ul.appendChild(liSignOut);
    userLinks.appendChild(ul);

    //gwt-activities-and-places
    ActivityMapper userActivityMapper = new UserActivityMapper();
    ActivityManager userActivityManager = new ActivityManager(userActivityMapper, App.getEventBus());
    userActivityManager.setDisplay(userDisplay);

    ActivityMapper addNoteActivityMapper = new AddNoteActivityMapper();
    ActivityManager addNoteActivityManager = new ActivityManager(addNoteActivityMapper, App.getEventBus());
    addNoteActivityManager.setDisplay(addNote);

    ActivityMapper navActivityMapper = new NavActivityMapper();
    ActivityManager navActivityManager = new ActivityManager(navActivityMapper, App.getEventBus());
    navActivityManager.setDisplay(nav);

    ActivityMapper mainActivityMapper = new AppActivityMapper();
    ActivityManager noteDisplayActivityManager = new ActivityManager(mainActivityMapper, App.getEventBus());
    noteDisplayActivityManager.setDisplay(mainDisplay);

    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(App.getPlaceHistoryMapper());
    historyHandler.register(App.getClientFactory().getPlaceController(), App.getEventBus(), defaultPlace);
    DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById(AppStyles.ID_SPLASH));

    RootPanel.get(AppStyles.BODY_PANEL_USER_ID).add(userDisplay);
    RootPanel.get(AppStyles.BODY_PANEL_TOP_ID).add(addNote);
    RootPanel.get(AppStyles.BODY_PANEL_CONTENT_ID).add(mainDisplay);
    RootPanel.get(AppStyles.BODY_PANEL_NAV_ID).add(nav);

    historyHandler.handleCurrentHistory();

}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:46,代码来源:ListmakerMvp.java

示例11: DigitalObjectChildrenEditor

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
public DigitalObjectChildrenEditor(ClientMessages i18n, PlaceController places, OptionalEditor preview) {
        this.i18n = i18n;
        this.places = places;
        this.preview = preview;
        this.actionSource = new ActionSource(this);
        this.goDownAction = DigitalObjectNavigateAction.child(i18n, places);
        relationDataSource = RelationDataSource.getInstance();
        childrenListGrid = initChildrenListGrid();
        this.selectionCache = SelectionCache.selector(childrenListGrid);
        VLayout childrenLayout = new VLayout();
        childrenLayout.setMembers(childrenListGrid);
        childrenLayout.setWidth("40%");
        childrenLayout.setShowResizeBar(true);

        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        ActivityManager activityManager = new ActivityManager(
                new ChildActivities(childEditor), eventBus);

        VLayout editorsLayout = new VLayout();
        VLayout editorsOuterLayout = new VLayout();
//        editorsLayout.setBorder("1px solid grey");
        editorsLayout.addStyleName("defaultBorder");
        editorsOuterLayout.setLayoutLeftMargin(4);
        editorsOuterLayout.setMembers(editorsLayout);
        activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));

        widget = new HLayout();
        widget.setMembers(childrenLayout, editorsOuterLayout);
        relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {

            @Override
            public void onRelationChange(RelationChangeEvent event) {
                // issue 262: isVisible seems to be always true and isAttached is always null.
                // Add test isDrawn that seems to change for dettached widgets.
                if (digitalObject != null && childrenListGrid.isVisible() && childrenListGrid.isDrawn()) {
                    String changedPid = event.getPid();
                    if (changedPid != null) {
                        Record changedRecord = childrenListGrid.getDataAsRecordList()
                                .find(RelationDataSource.FIELD_PID, changedPid);
                        if (changedRecord == null) {
                            // moved object(s)
                            // ListGrid does not remove selection of removed/moved rows
                            // and it does not fire selection change
                            // issue 246: clear selection of moved row
                            childrenListGrid.deselectAllRecords();
                            DigitalObjectCopyMetadataAction.resetSelection();
                            showCopySelection(new Record[0]);
                            return ;
                        }
                    }
                    final ListGridRecord[] selection = childrenListGrid.getSelectedRecords();
                    relationDataSource.updateCaches(digitalObject.getPid(), new BooleanCallback() {

                        @Override
                        public void execute(Boolean value) {
                            // refresh the copy selection as updated records are missing the copy attribute
                            showCopySelection(DigitalObjectCopyMetadataAction.getSelection());
                            // refresh the list selection
                            selectChildren(selection);
                        }
                    });
                }
            }
        });
    }
 
开发者ID:proarc,项目名称:proarc,代码行数:68,代码来源:DigitalObjectChildrenEditor.java

示例12: init

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
private void init() {
  Utils.injectKaaStyles();

  ClientFactory clientFactory = GWT.create(ClientFactory.class);
  EventBus eventBus = clientFactory.getEventBus();

  dataSource = new DataSource(eventBus);

  ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
  ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
  headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());

  ActivityMapper navigationActivityMapper = new NavigationActivityMapper(
      clientFactory, eventBus);
  ActivityManager navigationActivityManager = new ActivityManager(
      navigationActivityMapper, eventBus);
  navigationActivityManager.setDisplay(appWidget.getNavContentHolder());

  ActivityMapper appActivityMapper = new AppActivityMapper(clientFactory);
  ActivityManager appActivityManager = new ActivityManager(appActivityMapper, eventBus);
  appActivityManager.setDisplay(appWidget.getAppContentHolder());

  PlaceHistoryMapper historyMapper = null;
  switch (authInfo.getAuthority()) {
    case KAA_ADMIN:
      historyMapper = GWT.create(KaaAdminPlaceHistoryMapper.class);
      clientFactory.setHomePlace(new TenantsPlace());
      break;
    case TENANT_ADMIN:
      historyMapper = GWT.create(TenantAdminPlaceHistoryMapper.class);
      clientFactory.setHomePlace(new ApplicationsPlace());
      break;
    case TENANT_DEVELOPER:
      historyMapper = GWT.create(TenantDeveloperPlaceHistoryMapper.class);
      clientFactory.setHomePlace(new ApplicationsPlace());
      break;
    case TENANT_USER:
      historyMapper = GWT.create(TenantUserPlaceHistoryMapper.class);
      clientFactory.setHomePlace(new ApplicationsPlace());
      break;
    default:
      break;
  }

  PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);

  Place place;
  if (authInfo.getAuthority() == KaaAuthorityDto.KAA_ADMIN) {
    place = new TenantsPlace();
  } else {
    place = new ApplicationsPlace();
  }

  PlaceController placeController = clientFactory.getPlaceController();
  historyHandler.register(placeController, eventBus, place);

  RootLayoutPanel.get().add(appWidget);

  // Goes to the place represented on URL else default place
  historyHandler.handleCurrentHistory();
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:62,代码来源:KaaAdmin.java

示例13: run

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void run(HasWidgets.ForIsWidget parentView) {

	setUncaughtExceptionHandler();

	log.info("DesktopApp is running.");

	setPlaceChangeEventHandler();

	shell.setEventBus(eventBus);

	ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
	activityManager.setDisplay(shell.getView());

	PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(placeHistoryMapper);
	placeHistoryHandler.register(placeController, eventBus, defaultPlace);

	parentView.add(shell.getView());

	placeHistoryHandler.handleCurrentHistory();
}
 
开发者ID:burakince,项目名称:open-course-organizer,代码行数:22,代码来源:DesktopApp.java

示例14: run

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void run() {

    /* Add handlers, setup activities */
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {

        @Override
        public void onUncaughtException(Throwable e) {

            /* open the umbrella if it's an umbrella */
            e = unwrapException(e);

            e.printStackTrace();
            LOG.log(Level.SEVERE, "Uncaught exception", e);
        }

        private static final int MAX_UNWRAPS = 10;

        private Throwable unwrapException(Throwable throwable) {

            Throwable result = throwable;
            int attempts = 0;

            while (attempts < MAX_UNWRAPS) {

                if (result instanceof UmbrellaException && ((UmbrellaException) result).getCauses().size() == 1) {
                    result = ((UmbrellaException) throwable).getCauses().iterator().next();
                } else if (result instanceof com.google.web.bindery.event.shared.UmbrellaException
                        && ((com.google.web.bindery.event.shared.UmbrellaException) result).getCauses().size() == 1) {
                    result = ((com.google.web.bindery.event.shared.UmbrellaException) throwable).getCauses()
                            .iterator().next();
                } else {
                    break;
                }

                attempts++;
            }
            return result;
        }
    });

    /* activity management */
    CachingActivityMapper cached = new CachingActivityMapper(mainActivityMapper);
    ActivityManager mainActivityManager = new ActivityManager(cached, eventBus);
    mainActivityManager.setDisplay(applicationActivity.getViewPanel());

    /* add a panel for the desktop to add to if it needs to */
    SimpleLayoutPanel sp = new SimpleLayoutPanel();
    RootLayoutPanel.get().add(sp);

    applicationActivity.start(sp, eventBus);
}
 
开发者ID:pillingworthz,项目名称:ifictionary,代码行数:53,代码来源:ZaxApplicationController.java

示例15: onModuleLoad

import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {

    RootView.Presenter rootPresenter = injector.getRootPresenter();

    PlaceControllerHolder placeControllerHolder = injector.getPlaceControllerHolder();

    // Initialize a manager per region
    ActivityManager northActivityManager = new ActivityManager(injector.getNorthActivityMapper(), placeControllerHolder.getEventBus());
    northActivityManager.setDisplay(rootPresenter.getView().getRegion(Region.North));

    ActivityManager westActivityManager = new ActivityManager(injector.getWestActivityMapper(), placeControllerHolder.getEventBus());
    westActivityManager.setDisplay(rootPresenter.getView().getRegion(Region.West));

    // Do the same for center, south ...


    AppPlaceHistoryMapper historyMapper= injector.getAppPlaceHistoryMapper();
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeControllerHolder.getPlaceController(), placeControllerHolder.getEventBus(), new Place1("test"));

    RootLayoutPanel.get().add(rootPresenter.getView().asWidget());

    // Activate navigation history and go to default place
    historyHandler.handleCurrentHistory();
}
 
开发者ID:ronanquillevere,项目名称:GWT-Multi-Activities,代码行数:27,代码来源:Multiactivities.java


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