Search in sources :

Example 1 with ThemeStyles

use of org.rstudio.core.client.theme.res.ThemeStyles in project rstudio by rstudio.

the class MinimizedModuleTabLayoutPanel method setTabs.

public void setTabs(String[] tabNames) {
    HorizontalPanel horiz = (HorizontalPanel) getExtraWidget();
    horiz.clear();
    ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
    for (int i = 0; i < tabNames.length; i++) {
        String tabName = tabNames[i];
        if (tabName == null)
            continue;
        ModuleTabLayoutPanel.ModuleTab tab = new ModuleTabLayoutPanel.ModuleTab(tabName, styles, false);
        tab.addStyleName("gwt-TabLayoutPanelTab");
        final Integer thisIndex = i;
        tab.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                event.preventDefault();
                SelectionEvent.fire(MinimizedModuleTabLayoutPanel.this, thisIndex);
            }
        });
        horiz.add(tab);
    }
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ThemeStyles(org.rstudio.core.client.theme.res.ThemeStyles)

Example 2 with ThemeStyles

use of org.rstudio.core.client.theme.res.ThemeStyles in project rstudio by rstudio.

the class PresentationPane method zoom.

@Override
public void zoom(String title, String url, final Command onClosed) {
    // create the titlebar (no title for now)
    HorizontalPanel titlePanel = new HorizontalPanel();
    ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
    Label titleLabel = new Label(title);
    titleLabel.addStyleName(styles.fullscreenCaptionLabel());
    titlePanel.add(titleLabel);
    // create the frame
    AnchorableFrame frame = new PresentationFrame(true);
    frame.setSize("100%", "100%");
    // create the popup panel & add close handler 
    activeZoomPanel_ = new FullscreenPopupPanel(titlePanel, frame, false);
    activeZoomPanel_.addCloseHandler(new CloseHandler<PopupPanel>() {

        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            activeZoomPanel_ = null;
            onClosed.execute();
        }
    });
    // load the frame and show the zoom panel
    frame.navigate(url);
    activeZoomPanel_.center();
}
Also used : FullscreenPopupPanel(org.rstudio.core.client.widget.FullscreenPopupPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ThemeStyles(org.rstudio.core.client.theme.res.ThemeStyles) Label(com.google.gwt.user.client.ui.Label) PopupPanel(com.google.gwt.user.client.ui.PopupPanel) FullscreenPopupPanel(org.rstudio.core.client.widget.FullscreenPopupPanel) AnchorableFrame(org.rstudio.core.client.widget.AnchorableFrame)

Example 3 with ThemeStyles

use of org.rstudio.core.client.theme.res.ThemeStyles in project rstudio by rstudio.

the class DesktopApplicationHeader method initialize.

@Inject
public void initialize(final Commands commands, EventBus events, final Session session, ApplicationServerOperations server, Provider<DesktopHooks> pDesktopHooks, Provider<CodeSearch> pCodeSearch, Provider<UIPrefs> pUIPrefs, ErrorManager errorManager, GlobalDisplay globalDisplay, ApplicationQuit appQuit) {
    session_ = session;
    eventBus_ = events;
    pUIPrefs_ = pUIPrefs;
    globalDisplay_ = globalDisplay;
    ignoredUpdates_ = IgnoredUpdates.create();
    server_ = server;
    appQuit_ = appQuit;
    binder_.bind(commands, this);
    commands.mainMenu(new DesktopMenuCallback());
    pDesktopHooks.get();
    commands.uploadFile().remove();
    commands.exportFiles().remove();
    commands.updateCredentials().remove();
    commands.checkForUpdates().setVisible(true);
    commands.showLogFiles().setVisible(true);
    commands.diagnosticsReport().setVisible(true);
    commands.showFolder().setVisible(true);
    events.addHandler(SessionInitEvent.TYPE, new SessionInitHandler() {

        public void onSessionInit(SessionInitEvent sie) {
            final SessionInfo sessionInfo = session.getSessionInfo();
            toolbar_.completeInitialization(sessionInfo);
            new JSObjectStateValue("updates", "ignoredUpdates", ClientState.PERSISTENT, session_.getSessionInfo().getClientState(), false) {

                @Override
                protected void onInit(JsObject value) {
                    if (value != null)
                        ignoredUpdates_ = value.cast();
                }

                @Override
                protected JsObject getValue() {
                    ignoredUpdatesDirty_ = false;
                    return ignoredUpdates_.cast();
                }

                @Override
                protected boolean hasChanged() {
                    return ignoredUpdatesDirty_;
                }
            };
            Scheduler.get().scheduleFinally(new ScheduledCommand() {

                public void execute() {
                    Desktop.getFrame().onWorkbenchInitialized(sessionInfo.getScratchDir());
                    if (sessionInfo.getDisableCheckForUpdates())
                        commands.checkForUpdates().remove();
                    if (!sessionInfo.getDisableCheckForUpdates() && pUIPrefs_.get().checkForUpdates().getValue()) {
                        checkForUpdates(false);
                    }
                }
            });
        }
    });
    events.addHandler(ShowFolderEvent.TYPE, new ShowFolderHandler() {

        public void onShowFolder(ShowFolderEvent event) {
            Desktop.getFrame().showFolder(event.getPath().getPath());
        }
    });
    toolbar_ = new GlobalToolbar(commands, events, pCodeSearch);
    ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
    toolbar_.addStyleName(styles.desktopGlobalToolbar());
}
Also used : JsObject(org.rstudio.core.client.js.JsObject) SessionInitEvent(org.rstudio.studio.client.workbench.events.SessionInitEvent) ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) DesktopMenuCallback(org.rstudio.core.client.command.impl.DesktopMenuCallback) ShowFolderEvent(org.rstudio.studio.client.workbench.views.files.events.ShowFolderEvent) GlobalToolbar(org.rstudio.studio.client.application.ui.GlobalToolbar) ThemeStyles(org.rstudio.core.client.theme.res.ThemeStyles) SessionInfo(org.rstudio.studio.client.workbench.model.SessionInfo) SessionInitHandler(org.rstudio.studio.client.workbench.events.SessionInitHandler) JSObjectStateValue(org.rstudio.studio.client.workbench.model.helper.JSObjectStateValue) ShowFolderHandler(org.rstudio.studio.client.workbench.views.files.events.ShowFolderHandler) Inject(com.google.inject.Inject)

Aggregations

ThemeStyles (org.rstudio.core.client.theme.res.ThemeStyles)3 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Label (com.google.gwt.user.client.ui.Label)1 PopupPanel (com.google.gwt.user.client.ui.PopupPanel)1 Inject (com.google.inject.Inject)1 DesktopMenuCallback (org.rstudio.core.client.command.impl.DesktopMenuCallback)1 JsObject (org.rstudio.core.client.js.JsObject)1 AnchorableFrame (org.rstudio.core.client.widget.AnchorableFrame)1 FullscreenPopupPanel (org.rstudio.core.client.widget.FullscreenPopupPanel)1 GlobalToolbar (org.rstudio.studio.client.application.ui.GlobalToolbar)1 SessionInitEvent (org.rstudio.studio.client.workbench.events.SessionInitEvent)1 SessionInitHandler (org.rstudio.studio.client.workbench.events.SessionInitHandler)1 SessionInfo (org.rstudio.studio.client.workbench.model.SessionInfo)1 JSObjectStateValue (org.rstudio.studio.client.workbench.model.helper.JSObjectStateValue)1 ShowFolderEvent (org.rstudio.studio.client.workbench.views.files.events.ShowFolderEvent)1 ShowFolderHandler (org.rstudio.studio.client.workbench.views.files.events.ShowFolderHandler)1