@Override public DashletSpec clone() { DashletSpec dashletSpec = new DashletSpec(); dashletSpec.setPriority(getPriority()); dashletSpec.setDuration(getDuration()); dashletSpec.setBoostPriority(getBoostPriority()); dashletSpec.setBoostDuration(getBoostDuration()); dashletSpec.setDashletName(getDashletName()); return dashletSpec; } }
public void buttonClick(Button.ClickEvent clickEvent) { addDashletSpec(new DashletSpec()); } });
/** * Copy constructor. * * @param wallboard the {@link Wallboard} to be cloned */ public Wallboard(Wallboard wallboard) { m_title = wallboard.getTitle(); for (DashletSpec dashletSpec : wallboard.getDashletSpecs()) { this.m_dashletSpecs.add(dashletSpec.clone()); } }
/** * Constructor for instantiating new objects. * * @param dashletSpec the {@link DashletSpec} to be used * @param businessServiceManager the {@link BusinessServiceManager} to be used */ public BSMDashlet(String name, DashletSpec dashletSpec, BusinessServiceManager businessServiceManager, TransactionAwareBeanProxyFactory transactionAwareBeanProxyFactory) { super(name, dashletSpec); m_businessServiceManager = transactionAwareBeanProxyFactory.createProxy(businessServiceManager); m_businessServiceSearchCriteria = BSMConfigHelper.fromMap(getDashletSpec().getParameters()); m_columnCountBoard = BSMConfigHelper.getIntForKey(getDashletSpec().getParameters(), "columnCountBoard", 10); m_columnCountPanel = BSMConfigHelper.getIntForKey(getDashletSpec().getParameters(), "columnCountPanel", 5); }
/** * Standard constructor for this class. */ public DashletConfigurationWindow() { /** * Setting the title */ super("Configuration"); /** * Setting the modal and size properties */ setModal(true); setClosable(false); setResizable(false); setWidth(60, Unit.PERCENTAGE); setHeight(80, Unit.PERCENTAGE); } }
public Dashlet getDashletInstance(DashletSpec dashletSpec) { DashletSelector dashletSelector = ((DashletSelectorAccess) getUI()).getDashletSelector(); Dashlet dashlet = dashletSelector.getDashletFactoryForName(dashletSpec.getDashletName()).newDashletInstance(dashletSpec); dashlet.getWallboardComponent(getUI()).getComponent().setCaption(null); return dashlet; }
/** * Method for retrieving {@link Dashlet} instances for a given {@link DashletSpec}. * * @param dashletSpec the {@link DashletSpec} to be used * @return the new {@link Dashlet} instance */ private Dashlet getDashletInstance(DashletSpec dashletSpec) { DashletSelector dashletSelector = ((DashletSelectorAccess) getUI()).getDashletSelector(); return dashletSelector.getDashletFactoryForName(dashletSpec.getDashletName()).newDashletInstance(dashletSpec); }
private boolean suitableForDashboard(DashletSpec dashletSpec) { DashletSelector dashletSelector = ((DashletSelectorAccess) getUI()).getDashletSelector(); return dashletSelector.getDashletFactoryForName(dashletSpec.getDashletName()).isSuitableForDashboard(); }
/** * Checks whether this object contains {@link Wallboard} data concerning the given title. * * @param title the title to search for * @return true, if a {@link Wallboard} with the given title exists, false otherwise */ public synchronized boolean containsWallboard(String title) { for (Wallboard wallboard : m_wallboards.getWallboards()) { if (wallboard.getTitle().equals(title)) { return true; } } return false; }
@Override public void buttonClick(Button.ClickEvent clickEvent) { DashletConfigurationWindow configurationWindow = m_dashletSelector.getDashletFactoryForName(m_dashletSpec.getDashletName()).configurationWindow(m_dashletSpec); getUI().addWindow(configurationWindow); } });
/** * Returns the help component for the {@link Dashlet}. * * @return the help component */ @Override public Component getHelpComponent() { VerticalLayout verticalLayout = new VerticalLayout(); Label helpContent = new Label(getHelpContentHTML(), ContentMode.HTML); helpContent.addStyleName("help-content"); Label helpParameters = new Label(getParameterDescriptionsHTML(), ContentMode.HTML); helpParameters.addStyleName("help-content"); verticalLayout.addComponent(helpContent); verticalLayout.addComponent(helpParameters); return verticalLayout; }
/** * Checks whether this object contains a given {@link Wallboard} instance. * * @param wallboard the {@link Wallboard} instance to search for * @return true, if the {@link Wallboard} exists, false otherwise */ public synchronized boolean containsWallboard(Wallboard wallboard) { return m_wallboards.getWallboards().contains(wallboard); }
/** * Updates the vertical layout to reflect ordering changes */ public void updateDashletSpecs() { m_verticalLayout.removeAllComponents(); for (DashletSpec dashletSpec : m_wallboard.getDashletSpecs()) { m_verticalLayout.addComponent(m_dashletSpecEditorMap.get(dashletSpec)); } }
/** * This method loads the configuration data from disk. */ public synchronized void load() { if (!m_cfgFile.exists()) { m_wallboards = new Wallboards(); } else { m_wallboards = JaxbUtils.unmarshal(Wallboards.class, m_cfgFile); } }
public void gotoWallboard(Wallboard wallboard) { m_nativeSelect.setValue(wallboard); UI.getCurrent().getNavigator().navigateTo("wallboard/" + wallboard.getTitle()); }
/** * Returns the {@link Wallboard} for the given title. * * @param title the title to search for * @return the {@link Wallboard} instance if found, null otherwise */ public synchronized Wallboard getWallboard(String title) { for (Wallboard wallboard : m_wallboards.getWallboards()) { if (wallboard.getTitle().equals(title)) { return wallboard; } } return null; }
/** * Method to return the {@link BeanItemContainer} associated with this object. * * @return the {@link BeanItemContainer} */ public BeanItemContainer<Wallboard> getBeanContainer() { return new BeanItemContainer<Wallboard>(Wallboard.class, m_wallboards.getWallboards()); }
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { if (event.getParameters() != null) { Wallboard wallboard = WallboardProvider.getInstance().getWallboard(event.getParameters()); if (wallboard != null) { dashletBoardBody.setDashletSpecs(wallboard.getDashletSpecs()); } } }
/** * This method adds a {@link Wallboard} to this provider. * * @param wallboard the {@link Wallboard} instance to be added */ public synchronized void addWallboard(Wallboard wallboard) { if (m_wallboards == null) { load(); } m_wallboards.getWallboards().add(wallboard); save(); }
/** * This method removes a {@link Wallboard} from this provider. * * @param wallboard the {@link Wallboard} instance to be removed */ public synchronized void removeWallboard(Wallboard wallboard) { if (m_wallboards == null) { load(); } m_wallboards.getWallboards().remove(wallboard); save(); } }