List of usage examples for com.google.gwt.user.client.ui RootLayoutPanel add
@Override public void add(Widget widget)
From source file:org.mindinformatics.gwt.domeo.client.Domeo.java
License:Apache License
public void completeInitialization() { // Preferences Preferences preferences = new Preferences(this); componentsManager.addComponent(preferences); // Images Cache imagesCache = new ImagesCache(this); componentsManager.addComponent(imagesCache); // Images mashup pmcImagesCache = new PmcImagesMetadataCache(this); // Resources//from www .jav a 2s . co m componentsManager.addComponent(resourcesManager); // Style this.getCssManager().setStrategy(new AnnotationTypeStyleStrategy(this)); // Persistence // persistenceManager = new AnnotationPersistenceManager(this); // componentsManager.addComponent(persistenceManager); _persistenceManager = this.selectPersistenceManager(); if (_persistenceManager != null) { this.getLogger().debug(this.getClass().getName(), "Persistence manager selected " + _persistenceManager.getClass().getName()); componentsManager.addComponent(_persistenceManager); pluginsManager.registerPlugin(PersistencePlugin.getInstance()); } // Clipboard clipboardManager = new ClipboardManager(); componentsManager.addComponent(clipboardManager); accessManager = new AnnotationAccessManager(this); componentsManager.addComponent(accessManager); // Components initialization componentsManager.initializeComponents(); getInitializer().updateMessage("Creating Domeo UI..."); domeoToolbarPanel = new DomeoToolbarPanel(this); componentsManager.addComponent(domeoToolbarPanel); p.addNorth(domeoToolbarPanel, 31); // p.addSouth(new HTML("footer"), 20); // p.addWest(s, 200); // placeholder.setStyleName("sidebarPlaceholder"); sidePanelsFacade = new SidePanelsFacade(this, p); componentsManager.addComponent(sidePanelsFacade); p.addEast(sidePanelsFacade.getSidePanelsContainer(), 35); jsonUnmarshallingManager = new JsonUnmarshallingManager(this); // eastPanel = new EastPanelsContainer(this); // componentsManager.addComponent(eastPanel); // p.addEast(eastPanel, 15); contentPanel = new ContentPanel(this); p.add(contentPanel); resourcePanelsManager.registerResourcePanel(MGenericResource.class.getName(), new LGenericResourceCardPanel(this)); // resourcePanelsManager.registerResourcePanel(MOnlineResource.class.getName(), // new LOnlineResourceCardPanel(this)); resourcePanelsManager.registerResourcePanel(MDocumentResource.class.getName(), new LDocumentResourceCardPanel(this)); // OMIM Plugin pluginsManager.registerPlugin(OmimPlugin.getInstance()); if (_profileManager.getUserCurrentProfile().isPluginEnabled(OmimPlugin.getInstance().getPluginName())) { resourcePanelsManager.registerResourcePanel(MOmimDocument.class.getName(), new LOmimDocumentCardPanel(this)); pluginsManager.enablePlugin(OmimPlugin.getInstance(), true); } // Open Trials Plugin pluginsManager.registerPlugin(OpenTrialsPlugin.getInstance()); if (_profileManager.getUserCurrentProfile() .isPluginEnabled(OpenTrialsPlugin.getInstance().getPluginName())) { resourcePanelsManager.registerResourcePanel(MOpenTrialsDocument.class.getName(), new LOpenTrialsDocumentCardPanel(this)); pluginsManager.enablePlugin(OpenTrialsPlugin.getInstance(), true); } // Pubmed Plugin and Pubmed Central Plugin // PMC plugin is dependent from the PubMed plugin pluginsManager.registerPlugin(PubMedPlugin.getInstance()); pluginsManager.registerPlugin(PmcPlugin.getInstance()); if (_profileManager.getUserCurrentProfile().isPluginEnabled(PubMedPlugin.getInstance().getPluginName())) { resourcePanelsManager.registerResourcePanel(MPubMedDocument.class.getName(), new LPubMedDocumentCardPanel(this)); pluginsManager.enablePlugin(PubMedPlugin.getInstance(), true); if (_profileManager.getUserCurrentProfile().isPluginEnabled(PmcPlugin.getInstance().getPluginName())) { pluginsManager.enablePlugin(PmcPlugin.getInstance(), true); } } pluginsManager.registerPlugin(DocumentPlugin.getInstance(), true); pluginsManager.registerPlugin(BioPortalPlugin.getInstance(), true); annotationCardsManager.registerAnnotationCard(MAnnotationCitationReference.class.getName(), new ReferenceCardProvider(this)); // Selection pluginsManager.registerPlugin(SelectionPlugin.getInstance(), true); annotationTailsManager.registerAnnotationTile(MSelectionAnnotation.class.getName(), new SelectionTileProvider(this)); // Highlight pluginsManager.registerPlugin(HighlightPlugin.getInstance(), true); annotationTailsManager.registerAnnotationTile(MHighlightAnnotation.class.getName(), new HighlightTileProvider(this)); annotationCardsManager.registerAnnotationCard(MHighlightAnnotation.class.getName(), new HighlightCardProvider(this)); searchComponentsManager.registerAnnotationCard(MHighlightAnnotation.class.getName(), new HighligthSearchComponent(this)); // SPLs pluginsManager.registerPlugin(SPLsPlugin.getInstance(), true); // pluginsManager.enablePlugin(SPLsPlugin.getInstance(), false); // Paolo added the check to see if the PLugin is enabled if (_profileManager.getUserCurrentProfile().isPluginEnabled(SPLsPlugin.getInstance().getPluginName())) { annotationFormsManager.registerAnnotationForm(MSPLsAnnotation.class.getName(), new SPLsFormProvider(this)); } annotationTailsManager.registerAnnotationTile(MSPLsAnnotation.class.getName(), new SPLsTileProvider(this)); annotationCardsManager.registerAnnotationCard(MSPLsAnnotation.class.getName(), new SPLsCardProvider(this)); searchComponentsManager.registerAnnotationCard(MSPLsAnnotation.class.getName(), new SPLsSearchComponent(this)); // Post It /* * pluginsManager.registerPlugin(PostitPlugin.getInstance(), true); * annotationFormsManager * .registerAnnotationForm(MPostItAnnotation.class.getName(), new * PostItFormProvider(this)); annotationTailsManager * .registerAnnotationTile(MPostItAnnotation.class.getName(), new * PostItTileProvider(this)); annotationCardsManager * .registerAnnotationCard(MPostItAnnotation.class.getName(), new * PostItCardProvider(this)); * searchComponentsManager.registerAnnotationCard * (MPostItAnnotation.class .getName(), new * PostItSearchComponent(this)); */ // Qualifier pluginsManager.registerPlugin(QualifierPlugin.getInstance(), true); //pluginsManager.enablePlugin(QualifierPlugin.getInstance(), true); if (_profileManager.getUserCurrentProfile() .isPluginEnabled(QualifierPlugin.getInstance().getPluginName())) { annotationFormsManager.registerAnnotationForm(MQualifierAnnotation.class.getName(), new QualifierFormProvider(this)); } annotationTailsManager.registerAnnotationTile(MQualifierAnnotation.class.getName(), new QualifierTileProvider(this)); annotationCardsManager.registerAnnotationCard(MQualifierAnnotation.class.getName(), new QualifierCardProvider(this)); searchComponentsManager.registerAnnotationCard(MQualifierAnnotation.class.getName(), new QualifierSearchComponent(this)); annotationHelpersManager.registerAnnotationHelper(MQualifierAnnotation.class.getName(), new HQualifierHelper()); // Curation annotationTailsManager.registerAnnotationTile(MCurationToken.class.getName(), new CurationTileProvider(this)); // Antibody /* * pluginsManager.registerPlugin(AntibodyPlugin.getInstance(), true); // * pluginsManager.enablePlugin(AntibodyPlugin.getInstance(), true); if * (_profileManager.getUserCurrentProfile().isPluginEnabled( * AntibodyPlugin.getInstance().getPluginName())) { * annotationFormsManager.registerAnnotationForm( * MAntibodyAnnotation.class.getName(), new AntibodyFormProvider(this)); * } * annotationTailsManager.registerAnnotationTile(MAntibodyAnnotation.class * .getName(), new AntibodyTileProvider(this)); * annotationCardsManager.registerAnnotationCard * (MAntibodyAnnotation.class .getName(), new * AntibodyCardProvider(this)); * searchComponentsManager.registerAnnotationCard( * MAntibodyAnnotation.class.getName(), new * AntibodySearchComponent(this)); */ // Micropublications pluginsManager.registerPlugin(MicroPublicationsPlugin.getInstance(), true); // pluginsManager.enablePlugin(MicroPublicationsPlugin.getInstance(), // false); if (_profileManager.getUserCurrentProfile() .isPluginEnabled(MicroPublicationsPlugin.getInstance().getPluginName())) { annotationFormsManager.registerAnnotationForm(MMicroPublicationAnnotation.class.getName(), new MicroPublicationFormProvider(this)); } annotationTailsManager.registerAnnotationTile(MMicroPublicationAnnotation.class.getName(), new MicroPublicationTileProvider(this)); annotationCardsManager.registerAnnotationCard(MMicroPublicationAnnotation.class.getName(), new MicroPublicationCardProvider(this)); getAnnotationPersistenceManager().registerCache(new MicroPublicationCache()); // Comments annotationTailsManager.registerAnnotationTile(MCommentAnnotation.class.getName(), new CommentTileProvider(this)); // ddi pluginsManager.registerPlugin(ddiPlugin.getInstance(), true); if (_profileManager.getUserCurrentProfile().isPluginEnabled(ddiPlugin.getInstance().getPluginName())) { annotationFormsManager.registerAnnotationForm(MddiAnnotation.class.getName(), new ddiFormProvider(this)); } annotationTailsManager.registerAnnotationTile(MddiAnnotation.class.getName(), new ddiTileProvider(this)); annotationCardsManager.registerAnnotationCard(MddiAnnotation.class.getName(), new ddiCardProvider(this)); // Comments annotationTailsManager.registerAnnotationTile(MCommentAnnotation.class.getName(), new CommentTileProvider(this)); annotationTailsManager.registerAnnotationTile(MLinearCommentAnnotation.class.getName(), new LinearCommentTileProvider(this)); // Digesters linkedDataDigestersManager.registerLnkedDataDigester(new NifStandardDigester()); linkedDataDigestersManager.registerLnkedDataDigester(new BioPortalTermsDigester()); sideTabPanel = sidePanelsFacade.getSideTabsContainer(); final ASideTab annotationsSideTab = new AnnotationSideTab(this, sidePanelsFacade); final ASideTab resourceSideTab = new ResourceSideTab(this, sidePanelsFacade); final ASideTab annotationSetsSideTab2 = new AnnotationSetSideTab(this, sidePanelsFacade); final ASideTab clipboardSideTab = new ClipboardSideTab(this, sidePanelsFacade); AnnotationSidePanel annotationSidePanel = new AnnotationSidePanel(this, sidePanelsFacade, annotationsSideTab); ResourceSidePanel resourceSidePanel = new ResourceSidePanel(this, sidePanelsFacade, resourceSideTab); AnnotationSetsSidePanel annotationSetsSidePanel2 = new AnnotationSetsSidePanel(this, sidePanelsFacade, annotationSetsSideTab2); ClipboardSidePanel clipboardSidePanel = new ClipboardSidePanel(this, sidePanelsFacade, clipboardSideTab); sidePanelsFacade.registerSideComponent(resourceSideTab, resourceSidePanel, (ResourceSideTab.HEIGHT + 16) + "px"); sidePanelsFacade.registerSideComponent(annotationsSideTab, annotationSidePanel, (AnnotationSideTab.HEIGHT + 16) + "px"); sidePanelsFacade.registerSideComponent(annotationSetsSideTab2, annotationSetsSidePanel2, (AnnotationSetSideTab.HEIGHT + 16) + "px"); /* * discussionSideTab = new CommentSideTab(this, sidePanelsFacade); // * if( * ((BooleanPreference)getPreferences().getPreferenceItem(Domeo.class. * getName(), Domeo.PREF_ALLOW_COMMENTING)).getValue()) { * CommentSidePanel commentSidePanel = new CommentSidePanel(this, * sidePanelsFacade, discussionSideTab); * sidePanelsFacade.registerSideComponent(discussionSideTab, * commentSidePanel, (CommentSideTab.HEIGHT+16) + "px"); } */ commentsSideTab = new LinearCommentsSideTab(this, sidePanelsFacade); if (((BooleanPreference) getPreferences().getPreferenceItem(Domeo.class.getName(), Domeo.PREF_ALLOW_COMMENTING)).getValue()) { LinearCommentsSidePanel commentsSidePanel = new LinearCommentsSidePanel(this, sidePanelsFacade, discussionSideTab); sidePanelsFacade.registerSideComponent(commentsSideTab, commentsSidePanel, (LinearCommentsSideTab.HEIGHT + 16) + "px"); } if (((BooleanPreference) this.getPreferences().getPreferenceItem(Application.class.getName(), Domeo.PREF_ANN_MULTIPLE_TARGETS)) != null && ((BooleanPreference) this.getPreferences().getPreferenceItem(Application.class.getName(), Domeo.PREF_ANN_MULTIPLE_TARGETS)).getValue()) { sidePanelsFacade.registerSideComponent(clipboardSideTab, clipboardSidePanel, (ClipboardSideTab.HEIGHT + 16) + "px"); } if (((BooleanPreference) getPreferences().getPreferenceItem(Domeo.class.getName(), Domeo.PREF_DISPLAY_ANNOTATION_FOR_DEBUG)).getValue()) { final ASideTab annotationsDebugSideTab = new AnnotationDebugSideTab(this, sidePanelsFacade); AnnotationDebugSidePanel annotationDebugSidePanel = new AnnotationDebugSidePanel(this, sidePanelsFacade, annotationsDebugSideTab); componentsManager.addComponent(annotationDebugSidePanel); sidePanelsFacade.registerSideComponent(annotationsDebugSideTab, annotationDebugSidePanel, (AnnotationDebugSideTab.HEIGHT + 16) + "px"); } // Filters urlEncodersManager = new UrlEncodersManager(); urlEncodersManager.registerFilter(new ScienceDirectUrlFilter()); // ----------------------------------- // TEXT MINING SERVICES REGISTRATION // =================================== TextMiningRegistry.getInstance(this).registerTextMiningService(BioPortalManager.getInstance()); TextMiningRegistry.getInstance(this).registerTextMiningService(NifManager.getInstance()); RootPanel rpp = RootPanel.get(); rpp.add(sideTabPanel); // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen // for // resize events on the window to ensure that its children are informed // of // possible size changes. RootLayoutPanel rp = RootLayoutPanel.get(); getInitializer().removeFromParent(); rp.add(p); Window.addResizeHandler(new ResizeHandler() { /* * Timer resizeTimer = new Timer() { * * @Override public void run() { Window.alert("Resized"); } }; */ @Override public void onResize(ResizeEvent event) { // resizeTimer.cancel(); // resizeTimer.schedule(250); notifyResizing(); } }); this.logger.info(this, "Domeo Creation completed"); this.logger.info(this, "-------------------------------------"); extractorsManager = new ContentExtractorsManager(this); componentsManager.addComponent(extractorsManager); /* * if(!ApplicationUtils.getUrlParameter("url").isEmpty()) * Window.alert("Url: " + ApplicationUtils.getUrlParameter("url")); * if(!ApplicationUtils.getUrlParameter("setId").isEmpty()) * Window.alert("Url: " + ApplicationUtils.getUrlParameter("setId")); * if(!ApplicationUtils.getUrlParameter("setIds").isEmpty()) * Window.alert("Url: " + ApplicationUtils.getUrlParameter("setIds")); */ if (!ApplicationUtils.getUrlParameter("url").isEmpty()) { domeoToolbarPanel.getAddressBarPanel() .setAddress(ApplicationUtils.decodeURIComponent(ApplicationUtils.getUrlParameter("url"))); this.attemptContentLoading( ApplicationUtils.decodeURIComponent(ApplicationUtils.getUrlParameter("url"))); } /* * if(ApplicationUtils.getDocumentUrl()!=null && * ApplicationUtils.getDocumentUrl().trim().length()>13) { * domeoToolbarPanel * .getAddressBarPanel().setAddress(ApplicationUtils.getDocumentUrl()); * this.attemptContentLoading(ApplicationUtils.getDocumentUrl()); } */ }
From source file:org.mklab.taskit.client.Taskit.java
License:Apache License
/** * This is the entry point method./* w w w .j a v a 2 s . c o m*/ */ @Override public void onModuleLoad() { final ClientFactory clientFactory = GWT.create(ClientFactory.class); final EventBus eventBus = clientFactory.getEventBus(); final PlaceController placeController = clientFactory.getPlaceController(); final ActivityMapper activityMapper = new TaskitActivityMapper(clientFactory); final ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); activityManager.setDisplay(this.appWidget); final PlaceHistoryMapper historyMapper = GWT.create(TaskitPlaceHistoryMapper.class); final PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, this.defaultPlace); final RootLayoutPanel rootPanel = RootLayoutPanel.get(); rootPanel.add(this.appWidget); historyHandler.handleCurrentHistory(); }
From source file:org.onebusaway.webapp.gwt.common.resources.StandardApplicationContainer.java
License:Apache License
public static void add(Widget widget) { RootLayoutPanel panel = RootLayoutPanel.get(); panel.add(widget); panel.setWidgetTopBottom(widget, 43, Unit.PX, 0, Unit.PX); StyleInjector.inject(CommonResources.INSTANCE.getApplicationCss().getText()); }
From source file:org.penpusher.client.Penpusher.java
License:Open Source License
@Override public void onModuleLoad() { final SimpleEventBus eventBus = new SimpleEventBus(); final ApplicationModel model = ApplicationModel.create(eventBus); final ApplicationController ctrl = new ApplicationController(eventBus); // Instantiates view final RootLayoutPanel root = RootLayoutPanel.get(); final MainPanel mainPane = new MainPanel(ctrl, model); root.add(mainPane); eventBus.addHandler(SessionEvent.TYPE, new SessionEventHandler() { @Override//w w w . j a va 2s .c o m public void onSession(final SessionEvent event) { // Load forms and categories. Forms must be loaded first. ctrl.loadForms(model.getFormModel()); ctrl.loadCategories(model.getCategoryModel()); } }); eventBus.addHandler(SignOutCompletedEvent.TYPE, new SignOutCompletedEventHandler() { @Override public void onSignOutCompleted(final SignOutCompletedEvent event) { root.remove(mainPane); root.add(new SignOutPanel()); } }); // Gets session information ctrl.getSession(model); }
From source file:org.rstudio.studio.client.application.Application.java
License:Open Source License
public void go(final RootLayoutPanel rootPanel, final Command dismissLoadingProgress) { Widget w = view_.getWidget();// w w w. jav a 2 s . c om rootPanel.add(w); rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX); rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX); // attempt init pClientInit_.get().execute(new ServerRequestCallback<SessionInfo>() { public void onResponseReceived(final SessionInfo sessionInfo) { // initialize workbench after verifying agreement verifyAgreement(sessionInfo, new Operation() { public void execute() { dismissLoadingProgress.execute(); session_.setSessionInfo(sessionInfo); // hide the workbench if we have a project parameter // (since we are going to redirect anyway) if (haveProjectParameter()) hideWorkbench(rootPanel); // initialize workbench initializeWorkbench(); // reload application if we have a project parameter if (haveProjectParameter()) reloadApplication(sessionInfo.getSwitchToProject()); } }); } public void onError(ServerError error) { Debug.logError(error); dismissLoadingProgress.execute(); globalDisplay_.showErrorMessage("RStudio Initialization Error", error.getUserMessage()); } }); }
From source file:org.rstudio.studio.client.application.Application.java
License:Open Source License
@Handler public void onShowRequestLog() { GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable reason) { Window.alert(reason.toString()); }/*from w w w . j a va 2 s. c o m*/ public void onSuccess() { final RequestLogVisualization viz = new RequestLogVisualization(); final RootLayoutPanel root = RootLayoutPanel.get(); root.add(viz); root.setWidgetTopBottom(viz, 10, Unit.PX, 10, Unit.PX); root.setWidgetLeftRight(viz, 10, Unit.PX, 10, Unit.PX); viz.addCloseHandler(new CloseHandler<RequestLogVisualization>() { public void onClose(CloseEvent<RequestLogVisualization> event) { root.remove(viz); } }); } }); }
From source file:org.rstudio.studio.client.application.Application.java
License:Open Source License
private void hideWorkbench(final RootLayoutPanel rootPanel) { final Label w = new Label(); w.getElement().getStyle().setBackgroundColor("#e1e2e5"); rootPanel.add(w); rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX); rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX); }
From source file:org.rstudio.studio.client.common.satellite.SatelliteApplication.java
License:Open Source License
public void go(RootLayoutPanel rootPanel, final Command dismissLoadingProgress) { // indicate that we are a satellite window satellite_.initialize(name_, new CommandWithArg<JavaScriptObject>() { @Override//from www .ja va 2 s . co m public void execute(JavaScriptObject params) { view_.reactivate(params); } }); if (!manuallyFlushPendingEvents()) { flushPendingEvents(); } // inject ace themes pAceThemes_.get(); // register for uncaught exceptions (do this after calling // initSatelliteWindow b/c it depends on Server) uncaughtExHandler_.register(); // create the widget Widget w = view_.getWidget(); rootPanel.add(w); rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX); rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX); // show the view view_.show(satellite_.getParams()); // dismiss loading progress dismissLoadingProgress.execute(); }
From source file:org.simpledbm.samples.forum.client.SimpleForum.java
License:Open Source License
/** * This is the entry point method./*from w w w . j av a 2s.c o m*/ */ public void onModuleLoad() { DockLayoutPanel outer = new DockLayoutPanel(Unit.EM); outer.addNorth(topPanel, 5); SplitLayoutPanel p = new SplitLayoutPanel(); p.addWest(forums, 192); p.addNorth(topics, 200); p.add(posts); outer.add(p); RootLayoutPanel root = RootLayoutPanel.get(); root.add(outer); requestProcessor.getForums(); }
From source file:org.xmlsh.jsonxmlspeed.client.Jsonxmlspeed.java
License:BSD License
/** * This is the entry point method./*from w ww.j a v a 2 s. c o m*/ */ public void onModuleLoad() { // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element RootLayoutPanel rootPanel = RootLayoutPanel.get(); rootPanel.add(shell = new Shell()); bDebug = Window.Location.getParameter("debug") != null; }