@Override public void buttonClick(Button.ClickEvent clickEvent) { importKscReport(Integer.valueOf(selectKSCReport.getValue().toString())); } });
/** * {@inheritDoc} */ @Override public void browserWindowResized(Page.BrowserWindowResizeEvent browserWindowResizeEvent) { String graphName = (String) m_graphSelect.getValue(); String resourceId = (String) m_resourceSelect.getValue(); if (graphName != null && resourceId != null) { replaceGraph(graphName, resourceId); } }
@Override public Void visit(SetTo setTo) { setTo.setStatus((Status) m_mapFunctionSeveritySelect.getValue()); return null; } });
private ReductionFunction getReduceFunction() { try { final ReductionFunction reductionFunction = ((Class<? extends ReductionFunction>) m_reduceFunctionNativeSelect.getValue()).newInstance(); reductionFunction.accept(new ReduceFunctionVisitor<Void>() { @Override public Void visit(HighestSeverity highestSeverity) { return null; } @Override public Void visit(HighestSeverityAbove highestSeverityAbove) { highestSeverityAbove.setThreshold((Status) m_thresholdStatusSelect.getValue()); return null; } @Override public Void visit(Threshold threshold) { threshold.setThreshold(Float.parseFloat(m_thresholdTextField.getValue())); return null; } @Override public Void visit(ExponentialPropagation exponentialPropagation) { exponentialPropagation.setBase(Double.parseDouble(m_exponentialPropagationBaseTextField.getValue())); return null; } }); return reductionFunction; } catch (final InstantiationException | IllegalAccessException e) { throw Throwables.propagate(e); } } }));
@SuppressWarnings("unchecked") private MapFunction getMapFunction() { try { final MapFunction mapFunction = ((Class<? extends MapFunction>) m_mapFunctionSelect.getValue()).newInstance(); mapFunction.accept(new MapFunctionVisitor<Void>() { @Override
@Override protected Integer getInternalValue() { if (disableSelection.getValue() != null && (Boolean) disableSelection.getValue()) { return 0; } else { return (Integer) combo.getValue(); } }
/** * Method for updating the {@link NativeSelect} instance to display the available {@link DashletFactory} instances. * * @param factoryList the list of available {@link DashletFactory} instances */ public void updateDashletSelection(List<DashletFactory> factoryList) { m_savingDisabled = true; String savedSelection = (m_dashletSelect.getValue() == null ? "Undefined" : m_dashletSelect.getValue().toString()); if (!m_dashletSelect.removeAllItems()) { LoggerFactory.getLogger(DashletSpecEditor.class).warn("problem removing items"); } for (DashletFactory dashletFactory : factoryList) { if (!"Undefined".equals(dashletFactory.getName())) { m_dashletSelect.addItem(dashletFactory.getName()); } } m_dashletSelect.select(savedSelection); m_savingDisabled = false; }
/** * Returns the {@link String} representation of this restriction. * * @return the restriction */ public String getRestriction() { CriteriaRestriction criteriaRestriction = CriteriaRestriction.valueOf(String.valueOf(m_restrictionSelect.getValue())); String criteria = criteriaRestriction.name() + "("; boolean first = true; for (AbstractField<?> abstractField : m_componentList) { if (!first) { criteria += ","; } criteria += CriteriaBuilderHelper.encode(abstractField.getValue().toString()); first = false; } criteria += ")"; return criteria; } }
@Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { ResourceId onmsResourceId = ResourceId.fromString((String) m_resourceSelect.getValue()); m_graphSelect.removeAllItems(); if (onmsResourceId != null) { Map<String, String> map = getSurveillanceViewService().getGraphResultsForResourceId(onmsResourceId); for (String string : map.keySet()) { m_graphSelect.addItem(map.get(string)); m_graphSelect.setItemCaption(map.get(string), string); } Iterator<?> i = m_graphSelect.getItemIds().iterator(); if (i.hasNext()) { m_graphSelect.select(i.next()); } } } });
@Override public void buttonClick(Button.ClickEvent event) { m_dashletSpec.getParameters().put("criteria", criteriaBuilderComponent.getCriteria()); m_dashletSpec.getParameters().put("boostSeverity", String.valueOf(m_boostedSeveritySelect.getValue())); WallboardProvider.getInstance().save(); ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Properties"); close(); } });
@Override public void buttonClick(Button.ClickEvent event) { m_dashletSpec.getParameters().put("maximizeWidth", (m_maximizeWidth.getValue() ? "true" : "false")); m_dashletSpec.getParameters().put("maximizeHeight", (m_maximizeHeight.getValue() ? "true" : "false")); m_dashletSpec.getParameters().put("chart", String.valueOf(m_chartSelect.getValue())); WallboardProvider.getInstance().save(); ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Properties"); close(); } });
@Override public void buttonClick(Button.ClickEvent event) { Map<Integer, String> reportsMap = kscPerformanceReportFactory.getReportList(); m_dashletSpec.getParameters().put("kscReport", reportsMap.get(m_kscSelect.getValue())); WallboardProvider.getInstance().save(); ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Properties"); close(); } });
/** * Updates the preview images on timeframe changes. */ private void updatePreview() { /** * getting the timeframe values */ int timeFrameValue; int timeFrameType; try { timeFrameValue = Integer.parseInt(m_timeFrameValue.getValue().toString()); } catch (NumberFormatException numberFormatException) { timeFrameValue = 1; } try { timeFrameType = Integer.parseInt(m_timeFrameType.getValue().toString()); } catch (NumberFormatException numberFormatException) { timeFrameType = Calendar.HOUR; } for (int y = 0; y < m_gridLayout.getRows(); y++) { for (int x = 0; x < m_gridLayout.getColumns(); x++) { if (m_gridLayout.getComponent(x, y) != null) { ((RrdGraphEntry) m_gridLayout.getComponent(x, y)).setPreviewTimeFrame(timeFrameType, timeFrameValue); } } } }
if (m_filterBySeverityCheckBox.getValue() && m_severitySelect.getValue() != null) { m_dashletSpec.getParameters().put("severityValue", m_severitySelect.getValue().toString()); } else { m_dashletSpec.getParameters().put("severityValue", Status.WARNING.getLabel()); if (m_filterBySeverityCheckBox.getValue() && m_compareOperatorSelect.getValue() != null) { m_dashletSpec.getParameters().put("severityCompareOperator", m_compareOperatorSelect.getValue().toString()); } else { m_dashletSpec.getParameters().put("severityCompareOperator", BusinessServiceSearchCriteriaBuilder.CompareOperator.GreaterOrEqual.name()); if (m_orderBy.getValue() != null) { m_dashletSpec.getParameters().put("orderBy", m_orderBy.getValue().toString()); } else { m_dashletSpec.getParameters().put("orderBy", BusinessServiceSearchCriteriaBuilder.Order.Name.name()); if (m_orderSequence.getValue() != null) { m_dashletSpec.getParameters().put("orderSequence", m_orderSequence.getValue().toString()); } else { m_dashletSpec.getParameters().put("orderSequence", "Ascending");
@Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { Integer onmsNodeId = (Integer) m_nodeSelect.getValue(); m_resourceSelect.removeAllItems(); if (onmsNodeId != null) { Map<OnmsResourceType, List<OnmsResource>> map = getSurveillanceViewService().getResourceTypeMapForNodeId(onmsNodeId); for (OnmsResourceType onmsResourceType : map.keySet()) { for (OnmsResource onmsResource : map.get(onmsResourceType)) { m_resourceSelect.addItem(onmsResource.getId().toString()); m_resourceSelect.setItemCaption(onmsResource.getId().toString(), onmsResourceType.getLabel() + ": " + onmsResource.getLabel()); } } Iterator<?> i = m_resourceSelect.getItemIds().iterator(); if (i.hasNext()) { m_resourceSelect.select(i.next()); } } } });
m_dashletSpec.getParameters().put("columns", m_columnsSelect.getValue().toString()); m_dashletSpec.getParameters().put("rows", m_rowsSelect.getValue().toString()); timeFrameType = Integer.parseInt(m_timeFrameType.getValue().toString()); } catch (NumberFormatException numberFormatException) { timeFrameType = Calendar.HOUR;
@Override public void buttonClick(Button.ClickEvent event) { UI.getCurrent().getNavigator().addViewChangeListener(HeaderLayout.this); UI.getCurrent().getNavigator().navigateTo("dashboard/" + m_nativeSelect.getContainerProperty(m_nativeSelect.getValue(), "title").getValue()); } });
@Override public void buttonClick(Button.ClickEvent event) { UI.getCurrent().getNavigator().addViewChangeListener(HeaderLayout.this); UI.getCurrent().getNavigator().navigateTo("wallboard/" + m_nativeSelect.getContainerProperty(m_nativeSelect.getValue(), "title").getValue()); } });
Status selectedStatus = (Status) dropdown.getValue(); if (currentSetStatusTo != null) { currentSetStatusTo.setStatus(selectedStatus);