Package org.rhq.coregui.client.components.view

Examples of org.rhq.coregui.client.components.view.ViewFactory


        return sections;
    }

    private NavigationSection buildInventorySection() {
        NavigationItem resourceSelectorItem = new NavigationItem(PAGE_RESOURCE_SELECTOR, null, new ViewFactory() {
            public Canvas createView() {
                return new ResourceSelector();
            }
        });

        NavigationItem typeTreeItem = new NavigationItem(PAGE_TYPE_TREE, null, new ViewFactory() {
            public Canvas createView() {
                return new ResourceTypeTreeView(true);
            }
        });

        NavigationItem searchBarItem = new NavigationItem(PAGE_SEARCH_BAR, null, new ViewFactory() {
            public Canvas createView() {
                return new TestSearchBarView();
            }
        });
View Full Code Here


        return new NavigationSection(INVENTORY_SECTION_VIEW_ID, resourceSelectorItem, typeTreeItem, searchBarItem);
    }

    private NavigationSection buildConfigurationSection() {
        NavigationItem configEditorItem = new NavigationItem(PAGE_CONFIG_EDITOR, null, new ViewFactory() {
            public Canvas createView() {
                return new TestConfigurationView();
            }
        });

        NavigationItem readOnlyConfigEditorItem = new NavigationItem(PAGE_READONLY_CONFIG_EDITOR, null,
            new ViewFactory() {
                public Canvas createView() {
                    return new TestReadOnlyConfigurationView();
                }
            });

        NavigationItem groupConfigEditorItem = new NavigationItem(PAGE_GROUP_CONFIG_EDITOR, null, new ViewFactory() {
            public Canvas createView() {
                return new TestGroupConfigurationView();
            }
        });

        NavigationItem readOnlyGroupConfigEditorItem = new NavigationItem(PAGE_READONLY_GROUP_CONFIG_EDITOR, null,
            new ViewFactory() {
                public Canvas createView() {
                    return new TestReadOnlyGroupConfigurationView();
                }
            });
View Full Code Here

        return new NavigationSection(CONFIGURATION_SECTION_VIEW_ID, configEditorItem, readOnlyConfigEditorItem,
            groupConfigEditorItem, readOnlyGroupConfigEditorItem);
    }

    private NavigationSection buildServerAccessSection() {
        NavigationItem userPrefsItem = new NavigationItem(PAGE_USER_PREFERENCES, null, new ViewFactory() {
            public Canvas createView() {
                return new TestUserPreferencesView();
            }
        });

        NavigationItem remoteServiceStatisticsItem = new NavigationItem(PAGE_REMOTE_SERVICE_STATISTICS, null,
            new ViewFactory() {
                public Canvas createView() {
                    return new TestRemoteServiceStatisticsView();
                }
            });

        NavigationItem sqlItem = new NavigationItem(PAGE_SQL, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/sql.jsp");
            }
        });

        NavigationItem hibernateItem = new NavigationItem(PAGE_HIBERNATE, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/hibernate.jsp");
            }
        });

        NavigationItem entityBrowserItem = new NavigationItem(PAGE_ENTITY_BROWSER, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/browser.jsp");
            }
        });

        NavigationItem adminControlItem = new NavigationItem(PAGE_ADMIN_CONTROL, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/control.jsp");
            }
        });

        NavigationItem emailItem = new NavigationItem(PAGE_EMAIL, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/email.jsp");
            }
        });

        NavigationItem agentItem = new NavigationItem(PAGE_AGENT, null, new ViewFactory() {
            public Canvas createView() {
                return new FullHTMLPane("/portal/admin/test/agent.jsp");
            }
        });
View Full Code Here

        return new NavigationSection(SERVERACCESS_SECTION_VIEW_ID, remoteServiceStatisticsItem, sqlItem, hibernateItem,
            entityBrowserItem, adminControlItem, emailItem, agentItem, userPrefsItem);
    }

    private NavigationSection buildMiscSection() {
        NavigationItem messageCenterItem = new NavigationItem(PAGE_MESSAGE_CENTER_TEST, null, new ViewFactory() {
            public Canvas createView() {
                return new TestMessageCenterView();
            }
        });

        NavigationItem numberFormatItem = new NavigationItem(PAGE_NUMBER_FORMAT_TEST, null, new ViewFactory() {
            public Canvas createView() {
                return new TestNumberFormatView();
            }
        });
View Full Code Here

    }

    private NavigationSection buildProductSection() {

        NavigationItem aboutItem = new NavigationItem(new ViewName("AboutBox", MSG.view_help_section_product_about(),
            IconEnum.HELP), new ViewFactory() {
                public Canvas createView() {
                    final AboutModalWindow aboutModalWindow = new AboutModalWindow(productInfo);
                    aboutModalWindow.show();
                    return aboutModalWindow;
                }
View Full Code Here

                } catch (MissingResourceException e) {
                    icon = IconEnum.HELP.getIcon16x16Path();
                }

                final String itemName = "Section" + i + "Item" + j;
                NavigationItem item = new NavigationItem(new ViewName(itemName, title), icon, new ViewFactory() {
                    public Canvas createView() {
                        return new FullHTMLPane(url);
                    }
                });
                items[j - 1] = item;
View Full Code Here

          };
    }

    private NavigationSection buildResourcesSection() {
        NavigationItem autodiscoveryQueueItem = new NavigationItem(ResourceAutodiscoveryView.VIEW_ID,
            new ViewFactory() {
                public Canvas createView() {
                    return new ResourceAutodiscoveryView();
                }
            }, this.globalPermissions.contains(Permission.MANAGE_INVENTORY));
        autodiscoveryQueueItem.setRefreshRequired(true);

        NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, new ViewFactory() {
            public Canvas createView() {
                return createResourceSearchView(PAGE_ALL_RESOURCES, null);
            }
        });

        NavigationItem platformsItem = new NavigationItem(PAGE_PLATFORMS, new ViewFactory() {
            public Canvas createView() {
                Criteria initialCriteria = new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
                    ResourceCategory.PLATFORM.name());
                return createResourceSearchView(PAGE_PLATFORMS, initialCriteria);
            }
        });

        NavigationItem topLevelServersItem = new NavigationItem(PAGE_SERVERS_TOP, new ViewFactory() {
            public Canvas createView() {
                Criteria initialCriteria = new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
                    ResourceCategory.SERVER.name());
                initialCriteria.addCriteria(ResourceDatasource.FILTER_PARENT_CATEGORY, ResourceCategory.PLATFORM.name());
                return createResourceSearchView(PAGE_SERVERS_TOP, initialCriteria);
            }
        });

        NavigationItem serversItem = new NavigationItem(PAGE_SERVERS, new ViewFactory() {
            public Canvas createView() {
                Criteria initialCriteria = new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
                    ResourceCategory.SERVER.name());
                return createResourceSearchView(PAGE_SERVERS, initialCriteria);
            }
        });

        NavigationItem servicesItem = new NavigationItem(PAGE_SERVICES, new ViewFactory() {
            public Canvas createView() {

                Criteria initialCriteria = new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
                    ResourceCategory.SERVICE.name());
                return createResourceSearchView(PAGE_SERVICES, initialCriteria);
            }
        });

        NavigationItem ignoredResourcesItem = new NavigationItem(PAGE_IGNORED_RESOURCES, new ViewFactory() {
            public Canvas createView() {
                Criteria initialCriteria = new Criteria(ResourceDataSourceField.INVENTORY_STATUS.propertyName(),
                    InventoryStatus.IGNORED.name());
                initialCriteria.addCriteria(ResourceDataSourceField.PARENT_INVENTORY_STATUS.propertyName(),
                    InventoryStatus.COMMITTED.name());

                return createIgnoredResourceSearchView(PAGE_IGNORED_RESOURCES, initialCriteria);
            }
        });

        NavigationItem downServersItem = new NavigationItem(PAGE_UNAVAIL_SERVERS, new ViewFactory() {
            public Canvas createView() {
                Criteria initialCriteria = new Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
                    AvailabilityType.DOWN.name());
                initialCriteria.addCriteria(ResourceDataSourceField.CATEGORY.propertyName(),
                    ResourceCategory.SERVER.name());
View Full Code Here

        return new NavigationSection(RESOURCES_SECTION_VIEW_ID, autodiscoveryQueueItem, allResourcesItem,
            platformsItem, topLevelServersItem, serversItem, servicesItem, ignoredResourcesItem, downServersItem);
    }

    private NavigationSection buildGroupsSection() {
        NavigationItem dynagroupDefinitionsItem = new NavigationItem(PAGE_DYNAGROUP_DEFINITIONS, new ViewFactory() {
            public Canvas createView() {
                GroupDefinitionListView table =  new GroupDefinitionListView();
                table.setTitleString(PAGE_DYNAGROUP_DEFINITIONS.getTitle());
                table.setTitleIcon(PAGE_DYNAGROUP_DEFINITIONS.getIcon().getIcon24x24Path() );
                return table;
            }
        }, this.globalPermissions.contains(Permission.MANAGE_INVENTORY));

        NavigationItem allGroupsItem = new NavigationItem(PAGE_ALL_GROUPS, new ViewFactory() {
            public Canvas createView() {
                return new ResourceGroupListView(null, PAGE_ALL_GROUPS.getTitle(), PAGE_ALL_GROUPS.getIcon().getIcon24x24Path());
            }
        });

        NavigationItem compatibleGroupsItem = new NavigationItem(PAGE_COMPATIBLE_GROUPS, new ViewFactory() {
            public Canvas createView() {
                ResourceGroupListView view = new ResourceGroupListView(new Criteria(
                    ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.COMPATIBLE.name()),
                    PAGE_COMPATIBLE_GROUPS.getTitle(), PAGE_COMPATIBLE_GROUPS.getIcon().getIcon24x24Path());
                return view;
            }
        });

        NavigationItem mixedGroupsItem = new NavigationItem(PAGE_MIXED_GROUPS, new ViewFactory() {
            public Canvas createView() {
                ResourceGroupListView view = new ResourceGroupListView(new Criteria(
                    ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.MIXED.name()),
                    PAGE_MIXED_GROUPS.getTitle(), PAGE_MIXED_GROUPS.getIcon().getIcon24x24Path());
                return view;
            }
        });

        NavigationItem problemGroupsItem = new NavigationItem(PAGE_PROBLEM_GROUPS, new ViewFactory() {
            public Canvas createView() {
                ResourceGroupListView view =
                  new ResourceGroupListView(new Criteria("downMemberCount", "1"),
                    PAGE_PROBLEM_GROUPS.getTitle() , PAGE_PROBLEM_GROUPS.getIcon().getIcon24x24Path());
                view.setShowNewButton(false);
View Full Code Here

      t.setShowHeader(false);
      return t;
    }

    private void updateSummaryTabContent() {
        updateSubTab(this.summaryTab, this.summaryActivity, true, true, new ViewFactory() {
            @Override
            public Canvas createView() {
                return new ActivityView(resourceComposite);
            }
        });

        updateSubTab(this.summaryTab, this.summaryTimeline, true, true, new ViewFactory() {
            @Override
            public Canvas createView() {
              return new TimelineView(resourceComposite);
            }
        });
View Full Code Here

    private void updateInventoryTabContent(final ResourceComposite resourceComposite, final Resource resource,
        Set<ResourceTypeFacet> facets) {

        ResourceType type = this.resourceComposite.getResource().getResourceType();
        boolean visible = !type.getChildResourceTypes().isEmpty();
        ViewFactory viewFactory = (!visible) ? null : new ViewFactory() {
            @Override
            public Canvas createView() {
              return viewWithoutHeader(ResourceCompositeSearchView.getChildrenOf(resourceComposite));
            }
        };
        updateSubTab(this.inventoryTab, this.inventoryChildren, visible, true, viewFactory);

        visible = !type.getChildResourceTypes().isEmpty();
        viewFactory = (!visible) ? null : new ViewFactory() {
            @Override
            public Canvas createView() {
              return viewWithoutHeader(new ChildHistoryView(resourceComposite));
            }
        };
        updateSubTab(this.inventoryTab, this.inventoryChildHistory, visible, true, viewFactory);

        visible = facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION);
        viewFactory = (!visible) ? null : new ViewFactory() {
            @Override
            public Canvas createView() {
                return new PluginConfigurationEditView(resourceComposite);
            }
        };
        updateSubTab(this.inventoryTab, this.inventoryConn, visible, true, viewFactory);

        // same test, use above setting for 'visible'
        viewFactory = (!visible) ? null : new ViewFactory() {
            @Override
            public Canvas createView() {
              return viewWithoutHeader( new PluginConfigurationHistoryListView(resourceComposite.getResourcePermission().isInventory(),
                    resourceComposite.getResource().getId()));
            }
        };
        updateSubTab(this.inventoryTab, this.inventoryConnHistory, visible, true, viewFactory);

        final boolean canModifyMembership = globalPermissions.contains(Permission.MANAGE_INVENTORY);
        updateSubTab(this.inventoryTab, this.inventoryGroups, true, true, new ViewFactory() {
            @Override
            public Canvas createView() {
              return viewWithoutHeader(ResourceGroupListView.getGroupsOf(resource.getId(), canModifyMembership));
            }
        });

        boolean enabled = globalPermissions.contains(Permission.MANAGE_SETTINGS);
        viewFactory = (!enabled) ? null : new ViewFactory() {
            @Override
            public Canvas createView() {
              return new ResourceAgentView(resourceId);
            }
        };
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.view.ViewFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.