Search in sources :

Example 1 with IViewButton

use of org.eclipse.scout.rt.client.ui.action.view.IViewButton in project scout.rt by eclipse.

the class AbstractDesktop method initConfig.

protected void initConfig() {
    m_eventHistory = createEventHistory();
    // add convenience observer for event history
    addDesktopListener(new DesktopListener() {

        @Override
        public void desktopChanged(DesktopEvent e) {
            IEventHistory<DesktopEvent> h = getEventHistory();
            if (h != null) {
                h.notifyEvent(e);
            }
        }
    });
    ClientSessionProvider.currentSession().getMemoryPolicy().registerDesktop(this);
    BEANS.get(IDeviceTransformationService.class).install(this);
    initDesktopExtensions();
    setTitle(getConfiguredTitle());
    setCssClass(getConfiguredCssClass());
    setSelectViewTabsKeyStrokesEnabled(getConfiguredSelectViewTabsKeyStrokesEnabled());
    setSelectViewTabsKeyStrokeModifier(getConfiguredSelectViewTabsKeyStrokeModifier());
    setLogoId(getConfiguredLogoId());
    setDisplayStyle(getConfiguredDisplayStyle());
    initDisplayStyle(getDisplayStyle());
    setCacheSplitterPosition(getConfiguredCacheSplitterPosition());
    List<IDesktopExtension> extensions = getDesktopExtensions();
    m_contributionHolder = new ContributionComposite(this);
    // outlines
    OrderedCollection<IOutline> outlines = new OrderedCollection<IOutline>();
    for (IDesktopExtension ext : extensions) {
        try {
            ext.contributeOutlines(outlines);
        } catch (Exception t) {
            LOG.error("contributing outlines by {}", ext, t);
        }
    }
    List<IOutline> contributedOutlines = m_contributionHolder.getContributionsByClass(IOutline.class);
    outlines.addAllOrdered(contributedOutlines);
    // move outlines
    ExtensionUtility.moveModelObjects(outlines);
    setAvailableOutlines(outlines.getOrderedList());
    // actions (keyStroke, menu, viewButton, toolButton)
    List<IAction> actionList = new ArrayList<IAction>();
    for (IDesktopExtension ext : extensions) {
        try {
            ext.contributeActions(actionList);
        } catch (Exception t) {
            LOG.error("contributing actions by {}", ext, t);
        }
    }
    List<IAction> contributedActions = m_contributionHolder.getContributionsByClass(IAction.class);
    actionList.addAll(contributedActions);
    // build complete menu and viewButton lists
    // only top level menus
    OrderedComparator orderedComparator = new OrderedComparator();
    List<IMenu> menuList = new ActionFinder().findActions(actionList, IMenu.class, false);
    ExtensionUtility.moveModelObjects(menuList);
    Collections.sort(menuList, orderedComparator);
    m_menus = menuList;
    List<IViewButton> viewButtonList = new ActionFinder().findActions(actionList, IViewButton.class, false);
    ExtensionUtility.moveModelObjects(viewButtonList);
    Collections.sort(viewButtonList, orderedComparator);
    m_viewButtons = viewButtonList;
    // add dynamic keyStrokes
    List<IKeyStroke> ksList = new ActionFinder().findActions(actionList, IKeyStroke.class, true);
    for (IKeyStroke ks : ksList) {
        try {
            ks.initAction();
        } catch (RuntimeException | PlatformError e) {
            LOG.error("could not initialize key stroke '{}'.", ks, e);
        }
    }
    addKeyStrokes(ksList.toArray(new IKeyStroke[ksList.size()]));
    // init outlines
    for (IOutline o : m_availableOutlines) {
        try {
            o.initTree();
        } catch (Exception e) {
            LOG.error("Could not init outline {}", o, e);
        }
    }
    addPropertyChangeListener(new P_LocalPropertyChangeListener());
}
Also used : IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) ArrayList(java.util.ArrayList) IEventHistory(org.eclipse.scout.rt.client.ui.IEventHistory) IKeyStroke(org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke) OrderedComparator(org.eclipse.scout.rt.platform.OrderedComparator) IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) IAction(org.eclipse.scout.rt.client.ui.action.IAction) ContributionComposite(org.eclipse.scout.rt.shared.extension.ContributionComposite) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection) DeepLinkException(org.eclipse.scout.rt.client.deeplink.DeepLinkException) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException) VetoException(org.eclipse.scout.rt.platform.exception.VetoException) PlatformError(org.eclipse.scout.rt.platform.exception.PlatformError) IViewButton(org.eclipse.scout.rt.client.ui.action.view.IViewButton) IDeviceTransformationService(org.eclipse.scout.rt.client.transformation.IDeviceTransformationService) ActionFinder(org.eclipse.scout.rt.client.ui.action.ActionFinder)

Example 2 with IViewButton

use of org.eclipse.scout.rt.client.ui.action.view.IViewButton in project scout.rt by eclipse.

the class JsonObjectFactory method createJsonAdapter.

@SuppressWarnings("unchecked")
@Override
public IJsonAdapter<?> createJsonAdapter(Object model, IUiSession session, String id, IJsonAdapter<?> parent) {
    // --- form fields ----
    if (model instanceof IGroupBox) {
        // we must distinct between normal group-boxes and group-boxes in tab-boxes
        // the use the same model, but we need different adapters
        IGroupBox groupBox = (IGroupBox) model;
        if (groupBox.getParentField() instanceof ITabBox) {
            return new JsonTabItem<IGroupBox>(groupBox, session, id, parent);
        } else {
            return new JsonGroupBox<IGroupBox>(groupBox, session, id, parent);
        }
    }
    if (model instanceof ISequenceBox) {
        return new JsonSequenceBox<ISequenceBox>((ISequenceBox) model, session, id, parent);
    }
    if (model instanceof ITabBox) {
        return new JsonTabBox<ITabBox>((ITabBox) model, session, id, parent);
    }
    if (model instanceof IBooleanField) {
        return new JsonCheckBoxField<IBooleanField>((IBooleanField) model, session, id, parent);
    }
    if (model instanceof ILabelField) {
        return new JsonLabelField<ILabelField>((ILabelField) model, session, id, parent);
    }
    if (model instanceof IImageField) {
        return new JsonImageField<IImageField>((IImageField) model, session, id, parent);
    }
    if (model instanceof ITableField<?>) {
        return new JsonTableField<ITableField<? extends ITable>>((ITableField<?>) model, session, id, parent);
    }
    if (model instanceof IListBox<?>) {
        return new JsonListBox((IListBox<?>) model, session, id, parent);
    }
    if (model instanceof ITreeField) {
        return new JsonTreeField<ITreeField>((ITreeField) model, session, id, parent);
    }
    if (model instanceof ITreeBox<?>) {
        return new JsonTreeBox<ITreeBox>((ITreeBox<?>) model, session, id, parent);
    }
    if (model instanceof IRadioButton<?>) {
        return new JsonRadioButton<IRadioButton>((IRadioButton<?>) model, session, id, parent);
    }
    if (model instanceof IRadioButtonGroup<?>) {
        return new JsonRadioButtonGroup<IRadioButtonGroup>((IRadioButtonGroup<?>) model, session, id, parent);
    }
    if (model instanceof IButton) {
        return new JsonButton<IButton>((IButton) model, session, id, parent);
    }
    if (model instanceof IStringField) {
        return new JsonStringField<IStringField>((IStringField) model, session, id, parent);
    }
    if (model instanceof INumberField<?>) {
        return new JsonNumberField<INumberField>((INumberField<?>) model, session, id, parent);
    }
    if (model instanceof IProposalField2<?>) {
        return new JsonProposalField2((IProposalField2<?>) model, session, id, parent);
    }
    if (model instanceof ISmartField2<?>) {
        return new JsonSmartField2((ISmartField2<?>) model, session, id, parent);
    }
    if (model instanceof IContentAssistField<?, ?>) {
        return new JsonSmartField((IContentAssistField<?, ?>) model, session, id, parent);
    }
    if (model instanceof IProposalChooser) {
        return new JsonProposalChooser<IProposalChooser>((IProposalChooser) model, session, id, parent);
    }
    if (model instanceof IDateField) {
        return new JsonDateField<IDateField>((IDateField) model, session, id, parent);
    }
    if (model instanceof ICalendarField<?>) {
        return new JsonCalendarField<ICalendarField<? extends ICalendar>>((ICalendarField<?>) model, session, id, parent);
    }
    if (model instanceof IPlannerField<?>) {
        return new JsonPlannerField((IPlannerField<?>) model, session, id, parent);
    }
    if (model instanceof IWrappedFormField<?>) {
        return new JsonWrappedFormField<IWrappedFormField<? extends IForm>>((IWrappedFormField<?>) model, session, id, parent);
    }
    if (model instanceof ISplitBox) {
        return new JsonSplitBox<ISplitBox>((ISplitBox) model, session, id, parent);
    }
    if (model instanceof IPlaceholderField) {
        return new JsonPlaceholderField<IPlaceholderField>((IPlaceholderField) model, session, id, parent);
    }
    if (model instanceof IWizardProgressField) {
        return new JsonWizardProgressField<IWizardProgressField>((IWizardProgressField) model, session, id, parent);
    }
    if (model instanceof IHtmlField) {
        return new JsonHtmlField<IHtmlField>((IHtmlField) model, session, id, parent);
    }
    if (model instanceof IComposerField) {
        return new JsonComposerField<IComposerField>((IComposerField) model, session, id, parent);
    }
    if (model instanceof IBeanField) {
        return new JsonBeanField<IBeanField<?>>((IBeanField) model, session, id, parent);
    }
    if (model instanceof IFileChooserField) {
        return new JsonFileChooserField<IFileChooserField>((IFileChooserField) model, session, id, parent);
    }
    if (model instanceof IColorField) {
        return new JsonColorField<IColorField>((IColorField) model, session, id, parent);
    }
    if (model instanceof IBrowserField) {
        return new JsonBrowserField<IBrowserField>((IBrowserField) model, session, id, parent);
    }
    if (model instanceof IClipboardField) {
        return new JsonClipboardField<IClipboardField>((IClipboardField) model, session, id, parent);
    }
    // --- other model objects ---
    if (model instanceof IDesktop) {
        return new JsonDesktop<IDesktop>((IDesktop) model, session, id, parent);
    }
    if (model instanceof IFormMenu<?>) {
        return new JsonFormMenu((IFormMenu<?>) model, session, id, parent);
    }
    if (model instanceof IMenu) {
        return new JsonMenu<IMenu>((IMenu) model, session, id, parent);
    }
    if (model instanceof IKeyStroke) {
        return new JsonKeyStroke<IKeyStroke>((IKeyStroke) model, session, id, parent);
    }
    if (model instanceof ISearchForm) {
        return new JsonSearchForm<ISearchForm>((ISearchForm) model, session, id, parent);
    }
    if (model instanceof IForm) {
        return new JsonForm<IForm>((IForm) model, session, id, parent);
    }
    if (model instanceof IMessageBox) {
        return new JsonMessageBox<IMessageBox>((IMessageBox) model, session, id, parent);
    }
    if (model instanceof IDesktopNotification) {
        return new JsonDesktopNotification<IDesktopNotification>((IDesktopNotification) model, session, id, parent);
    }
    if (model instanceof IOutlineViewButton) {
        return new JsonOutlineViewButton<IOutlineViewButton>((IOutlineViewButton) model, session, id, parent);
    }
    if (model instanceof IViewButton) {
        return new JsonViewButton<IViewButton>((IViewButton) model, session, id, parent);
    }
    if (model instanceof ISearchOutline) {
        return new JsonSearchOutline<ISearchOutline>((ISearchOutline) model, session, id, parent);
    }
    if (model instanceof IOutline) {
        return new JsonOutline<IOutline>((IOutline) model, session, id, parent);
    }
    if (model instanceof ITree) {
        return new JsonTree<ITree>((ITree) model, session, id, parent);
    }
    if (model instanceof ITable) {
        ITable table = (ITable) model;
        IPage page = (IPage) table.getProperty(JsonOutlineTable.PROP_PAGE);
        if (page != null) {
            return new JsonOutlineTable<ITable>(table, session, id, parent, page);
        }
        return new JsonTable<ITable>(table, session, id, parent);
    }
    if (model instanceof IClientSession) {
        return new JsonClientSession<IClientSession>((IClientSession) model, session, id, parent);
    }
    if (model instanceof ICalendar) {
        return new JsonCalendar<ICalendar>((ICalendar) model, session, id, parent);
    }
    if (model instanceof CalendarComponent) {
        return new JsonCalendarComponent<CalendarComponent>((CalendarComponent) model, session, id, parent);
    }
    if (model instanceof IPlanner<?, ?>) {
        return new JsonPlanner<IPlanner>((IPlanner<?, ?>) model, session, id, parent);
    }
    if (model instanceof IFileChooser) {
        return new JsonFileChooser<IFileChooser>((IFileChooser) model, session, id, parent);
    }
    if (model instanceof IAggregateTableControl) {
        // needs to be before ITableControl
        return new JsonAggregateTableControl<IAggregateTableControl>((IAggregateTableControl) model, session, id, parent);
    }
    if (model instanceof IFormTableControl) {
        // needs to be before ITableControl
        return new JsonFormTableControl<IFormTableControl>((IFormTableControl) model, session, id, parent);
    }
    if (model instanceof ITableControl) {
        return new JsonTableControl<ITableControl>((ITableControl) model, session, id, parent);
    }
    if (model instanceof IStatusMenuMapping) {
        return new JsonStatusMenuMapping<IStatusMenuMapping>((IStatusMenuMapping) model, session, id, parent);
    }
    return null;
}
Also used : JsonTabItem(org.eclipse.scout.rt.ui.html.json.form.fields.tabbox.JsonTabItem) ITableField(org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField) IColorField(org.eclipse.scout.rt.client.ui.form.fields.colorfield.IColorField) JsonSearchForm(org.eclipse.scout.rt.ui.html.json.desktop.JsonSearchForm) JsonProposalField2(org.eclipse.scout.rt.ui.html.json.form.fields.smartfield.JsonProposalField2) JsonFormMenu(org.eclipse.scout.rt.ui.html.json.desktop.JsonFormMenu) IOutlineViewButton(org.eclipse.scout.rt.client.ui.desktop.outline.IOutlineViewButton) IAggregateTableControl(org.eclipse.scout.rt.client.ui.basic.table.controls.IAggregateTableControl) IFileChooser(org.eclipse.scout.rt.client.ui.basic.filechooser.IFileChooser) ICalendar(org.eclipse.scout.rt.client.ui.basic.calendar.ICalendar) JsonKeyStroke(org.eclipse.scout.rt.ui.html.json.action.keystroke.JsonKeyStroke) ISearchForm(org.eclipse.scout.rt.client.ui.desktop.outline.pages.ISearchForm) ITabBox(org.eclipse.scout.rt.client.ui.form.fields.tabbox.ITabBox) JsonMessageBox(org.eclipse.scout.rt.ui.html.json.messagebox.JsonMessageBox) JsonSplitBox(org.eclipse.scout.rt.ui.html.json.form.fields.splitbox.JsonSplitBox) IWizardProgressField(org.eclipse.scout.rt.client.ui.form.fields.wizard.IWizardProgressField) IImageField(org.eclipse.scout.rt.client.ui.form.fields.imagefield.IImageField) JsonClientSession(org.eclipse.scout.rt.ui.html.json.JsonClientSession) IMessageBox(org.eclipse.scout.rt.client.ui.messagebox.IMessageBox) IRadioButtonGroup(org.eclipse.scout.rt.client.ui.form.fields.radiobuttongroup.IRadioButtonGroup) JsonAggregateTableControl(org.eclipse.scout.rt.ui.html.json.table.control.JsonAggregateTableControl) JsonTableControl(org.eclipse.scout.rt.ui.html.json.table.control.JsonTableControl) JsonImageField(org.eclipse.scout.rt.ui.html.json.form.fields.imagefield.JsonImageField) IButton(org.eclipse.scout.rt.client.ui.form.fields.button.IButton) IFormMenu(org.eclipse.scout.rt.client.ui.form.IFormMenu) JsonNumberField(org.eclipse.scout.rt.ui.html.json.form.fields.numberfield.JsonNumberField) ISplitBox(org.eclipse.scout.rt.client.ui.form.fields.splitbox.ISplitBox) IFormTableControl(org.eclipse.scout.rt.client.ui.basic.table.controls.IFormTableControl) IBooleanField(org.eclipse.scout.rt.client.ui.form.fields.booleanfield.IBooleanField) JsonOutlineViewButton(org.eclipse.scout.rt.ui.html.json.desktop.JsonOutlineViewButton) IHtmlField(org.eclipse.scout.rt.client.ui.form.fields.htmlfield.IHtmlField) IPage(org.eclipse.scout.rt.client.ui.desktop.outline.pages.IPage) ISequenceBox(org.eclipse.scout.rt.client.ui.form.fields.sequencebox.ISequenceBox) ITreeField(org.eclipse.scout.rt.client.ui.form.fields.treefield.ITreeField) JsonDateField(org.eclipse.scout.rt.ui.html.json.form.fields.JsonDateField) IWrappedFormField(org.eclipse.scout.rt.client.ui.form.fields.wrappedform.IWrappedFormField) ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) JsonCalendarComponent(org.eclipse.scout.rt.ui.html.json.calendar.JsonCalendarComponent) JsonFormTableControl(org.eclipse.scout.rt.ui.html.json.table.control.JsonFormTableControl) IContentAssistField(org.eclipse.scout.rt.client.ui.form.fields.smartfield.IContentAssistField) JsonSearchOutline(org.eclipse.scout.rt.ui.html.json.desktop.JsonSearchOutline) JsonFileChooserField(org.eclipse.scout.rt.ui.html.json.form.fields.filechooserfield.JsonFileChooserField) JsonFileChooser(org.eclipse.scout.rt.ui.html.json.basic.filechooser.JsonFileChooser) JsonStringField(org.eclipse.scout.rt.ui.html.json.form.fields.stringfield.JsonStringField) IProposalField2(org.eclipse.scout.rt.client.ui.form.fields.smartfield2.IProposalField2) IDesktopNotification(org.eclipse.scout.rt.client.ui.desktop.notification.IDesktopNotification) JsonDesktopNotification(org.eclipse.scout.rt.ui.html.json.desktop.JsonDesktopNotification) IViewButton(org.eclipse.scout.rt.client.ui.action.view.IViewButton) JsonCalendarField(org.eclipse.scout.rt.ui.html.json.form.fields.calendar.JsonCalendarField) JsonTabBox(org.eclipse.scout.rt.ui.html.json.form.fields.tabbox.JsonTabBox) JsonWrappedFormField(org.eclipse.scout.rt.ui.html.json.form.fields.wrappedform.JsonWrappedFormField) JsonDesktop(org.eclipse.scout.rt.ui.html.json.desktop.JsonDesktop) JsonViewButton(org.eclipse.scout.rt.ui.html.json.desktop.JsonViewButton) JsonTreeBox(org.eclipse.scout.rt.ui.html.json.form.fields.treebox.JsonTreeBox) IListBox(org.eclipse.scout.rt.client.ui.form.fields.listbox.IListBox) IStatusMenuMapping(org.eclipse.scout.rt.client.ui.form.fields.IStatusMenuMapping) IBeanField(org.eclipse.scout.rt.client.ui.form.fields.beanfield.IBeanField) ITableControl(org.eclipse.scout.rt.client.ui.basic.table.controls.ITableControl) IDateField(org.eclipse.scout.rt.client.ui.form.fields.datefield.IDateField) IFileChooserField(org.eclipse.scout.rt.client.ui.form.fields.filechooserfield.IFileChooserField) IForm(org.eclipse.scout.rt.client.ui.form.IForm) IClipboardField(org.eclipse.scout.rt.client.ui.form.fields.clipboardfield.IClipboardField) JsonTreeField(org.eclipse.scout.rt.ui.html.json.form.fields.treefield.JsonTreeField) INumberField(org.eclipse.scout.rt.client.ui.form.fields.numberfield.INumberField) JsonRadioButtonGroup(org.eclipse.scout.rt.ui.html.json.form.fields.radiobutton.JsonRadioButtonGroup) JsonButton(org.eclipse.scout.rt.ui.html.json.form.fields.button.JsonButton) JsonCheckBoxField(org.eclipse.scout.rt.ui.html.json.form.fields.checkbox.JsonCheckBoxField) JsonRadioButton(org.eclipse.scout.rt.ui.html.json.form.fields.radiobutton.JsonRadioButton) ISmartField2(org.eclipse.scout.rt.client.ui.form.fields.smartfield2.ISmartField2) IBrowserField(org.eclipse.scout.rt.client.ui.form.fields.browserfield.IBrowserField) JsonWizardProgressField(org.eclipse.scout.rt.ui.html.json.form.fields.wizard.JsonWizardProgressField) JsonMenu(org.eclipse.scout.rt.ui.html.json.menu.JsonMenu) JsonGroupBox(org.eclipse.scout.rt.ui.html.json.form.fields.groupbox.JsonGroupBox) ITree(org.eclipse.scout.rt.client.ui.basic.tree.ITree) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) JsonListBox(org.eclipse.scout.rt.ui.html.json.form.fields.listbox.JsonListBox) JsonComposerField(org.eclipse.scout.rt.ui.html.json.form.fields.composer.JsonComposerField) IPlanner(org.eclipse.scout.rt.client.ui.basic.planner.IPlanner) IGroupBox(org.eclipse.scout.rt.client.ui.form.fields.groupbox.IGroupBox) IClientSession(org.eclipse.scout.rt.client.IClientSession) JsonClipboardField(org.eclipse.scout.rt.ui.html.json.form.fields.clipboardfield.JsonClipboardField) JsonSequenceBox(org.eclipse.scout.rt.ui.html.json.form.fields.sequencebox.JsonSequenceBox) IComposerField(org.eclipse.scout.rt.client.ui.form.fields.composer.IComposerField) ITreeBox(org.eclipse.scout.rt.client.ui.form.fields.treebox.ITreeBox) JsonStatusMenuMapping(org.eclipse.scout.rt.ui.html.json.form.fields.JsonStatusMenuMapping) IStringField(org.eclipse.scout.rt.client.ui.form.fields.stringfield.IStringField) IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) JsonOutlineTable(org.eclipse.scout.rt.ui.html.json.table.JsonOutlineTable) IKeyStroke(org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke) JsonLabelField(org.eclipse.scout.rt.ui.html.json.form.fields.labelfield.JsonLabelField) IPlaceholderField(org.eclipse.scout.rt.client.ui.form.fields.placeholder.IPlaceholderField) JsonBrowserField(org.eclipse.scout.rt.ui.html.json.form.fields.browserfield.JsonBrowserField) ISearchOutline(org.eclipse.scout.rt.client.ui.desktop.outline.ISearchOutline) JsonSmartField(org.eclipse.scout.rt.ui.html.json.form.fields.smartfield.JsonSmartField) JsonOutline(org.eclipse.scout.rt.ui.html.json.desktop.JsonOutline) JsonProposalChooser(org.eclipse.scout.rt.ui.html.json.form.fields.smartfield.JsonProposalChooser) ILabelField(org.eclipse.scout.rt.client.ui.form.fields.labelfield.ILabelField) JsonBeanField(org.eclipse.scout.rt.ui.html.json.form.fields.beanfield.JsonBeanField) JsonTable(org.eclipse.scout.rt.ui.html.json.table.JsonTable) JsonTree(org.eclipse.scout.rt.ui.html.json.tree.JsonTree) CalendarComponent(org.eclipse.scout.rt.client.ui.basic.calendar.CalendarComponent) JsonCalendarComponent(org.eclipse.scout.rt.ui.html.json.calendar.JsonCalendarComponent) JsonPlanner(org.eclipse.scout.rt.ui.html.json.basic.planner.JsonPlanner) JsonPlannerField(org.eclipse.scout.rt.ui.html.json.form.fields.plannerfield.JsonPlannerField) ICalendarField(org.eclipse.scout.rt.client.ui.form.fields.calendarfield.ICalendarField) JsonCalendar(org.eclipse.scout.rt.ui.html.json.calendar.JsonCalendar) IRadioButton(org.eclipse.scout.rt.client.ui.form.fields.button.IRadioButton) JsonHtmlField(org.eclipse.scout.rt.ui.html.json.form.fields.htmlfield.JsonHtmlField) JsonPlaceholderField(org.eclipse.scout.rt.ui.html.json.form.fields.placeholder.JsonPlaceholderField) JsonTableField(org.eclipse.scout.rt.ui.html.json.form.fields.tablefield.JsonTableField) JsonColorField(org.eclipse.scout.rt.ui.html.json.form.fields.colorfield.JsonColorField) JsonForm(org.eclipse.scout.rt.ui.html.json.form.JsonForm) IProposalChooser(org.eclipse.scout.rt.client.ui.form.fields.smartfield.IProposalChooser) IPlannerField(org.eclipse.scout.rt.client.ui.form.fields.plannerfield.IPlannerField) JsonSmartField2(org.eclipse.scout.rt.ui.html.json.form.fields.smartfield.JsonSmartField2)

Example 3 with IViewButton

use of org.eclipse.scout.rt.client.ui.action.view.IViewButton in project scout.rt by eclipse.

the class JsonDesktop method toJson.

@Override
public JSONObject toJson() {
    JSONObject json = super.toJson();
    json.put(IDesktop.PROP_DISPLAY_STYLE, getModel().getDisplayStyle());
    putAdapterIdProperty(json, IDesktop.PROP_ACTIVE_FORM, getModel().getActiveForm());
    putAdapterIdsProperty(json, "views", getModel().getViews(getModel()));
    putAdapterIdsProperty(json, "dialogs", getModel().getDialogs(getModel(), false));
    putAdapterIdsProperty(json, "messageBoxes", getModel().getMessageBoxes(getModel()));
    putAdapterIdsProperty(json, "notifications", getModel().getNotifications());
    putAdapterIdsProperty(json, "fileChoosers", getModel().getFileChoosers(getModel()));
    putAdapterIdsProperty(json, "menus", getModel().getMenus(), new DisplayableActionFilter<IMenu>());
    putAdapterIdsProperty(json, "addOns", getModel().getAddOns());
    putAdapterIdsProperty(json, "keyStrokes", getModel().getKeyStrokes(), new DisplayableActionFilter<IKeyStroke>());
    putAdapterIdsProperty(json, "viewButtons", getModel().getViewButtons(), new DisplayableActionFilter<IViewButton>());
    putAdapterIdProperty(json, "outline", getModel().getOutline(), new DisplayableOutlineFilter<IOutline>());
    if (getModel().getSelectedViews(getModel()).size() > 0) {
        putAdapterIdsProperty(json, "selectedViewTabs", getModel().getSelectedViews(getModel()));
    }
    return json;
}
Also used : IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) JSONObject(org.json.JSONObject) IViewButton(org.eclipse.scout.rt.client.ui.action.view.IViewButton) IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) IKeyStroke(org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke)

Aggregations

IKeyStroke (org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke)3 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)3 IViewButton (org.eclipse.scout.rt.client.ui.action.view.IViewButton)3 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)3 ArrayList (java.util.ArrayList)1 IClientSession (org.eclipse.scout.rt.client.IClientSession)1 DeepLinkException (org.eclipse.scout.rt.client.deeplink.DeepLinkException)1 IDeviceTransformationService (org.eclipse.scout.rt.client.transformation.IDeviceTransformationService)1 IEventHistory (org.eclipse.scout.rt.client.ui.IEventHistory)1 ActionFinder (org.eclipse.scout.rt.client.ui.action.ActionFinder)1 IAction (org.eclipse.scout.rt.client.ui.action.IAction)1 CalendarComponent (org.eclipse.scout.rt.client.ui.basic.calendar.CalendarComponent)1 ICalendar (org.eclipse.scout.rt.client.ui.basic.calendar.ICalendar)1 IFileChooser (org.eclipse.scout.rt.client.ui.basic.filechooser.IFileChooser)1 IPlanner (org.eclipse.scout.rt.client.ui.basic.planner.IPlanner)1 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 IAggregateTableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.IAggregateTableControl)1 IFormTableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.IFormTableControl)1 ITableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.ITableControl)1 ITree (org.eclipse.scout.rt.client.ui.basic.tree.ITree)1