gpt4 book ai didi

org.opennms.features.vaadin.dashboard.config.ui.WallboardProvider.getInstance()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 18:55:05 27 4
gpt4 key购买 nike

本文整理了Java中org.opennms.features.vaadin.dashboard.config.ui.WallboardProvider.getInstance()方法的一些代码示例,展示了WallboardProvider.getInstance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WallboardProvider.getInstance()方法的具体详情如下:
包路径:org.opennms.features.vaadin.dashboard.config.ui.WallboardProvider
类名称:WallboardProvider
方法名:getInstance

WallboardProvider.getInstance介绍

[英]Method to return the instance of this singleton.
[中]方法返回此单例的实例。

代码示例

代码示例来源:origin: OpenNMS/opennms

@Override
  protected boolean isValidValue(String s) {
    return (!WallboardProvider.getInstance().containsWallboard(s) || WallboardProvider.getInstance().getWallboard(s).equals(m_wallboard)) && !"".equals(s);
  }
});

代码示例来源:origin: OpenNMS/opennms

public void setWallboard(final String wallboardName) {
  final Wallboard wallboard = WallboardProvider.getInstance().getWallboard(wallboardName);
  m_nativeSelect.setValue(wallboard);
}

代码示例来源:origin: OpenNMS/opennms

public void swapDashletSpec(DashletSpec dashletSpec, int direction) {
  int index = m_wallboard.getDashletSpecs().indexOf(dashletSpec);
  if (index + direction >= 0 && index + direction < m_wallboard.getDashletSpecs().size()) {
    Collections.swap(m_wallboard.getDashletSpecs(), index, index + direction);
    updateDashletSpecs();
    WallboardProvider.getInstance().save();
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
  public void buttonClick(Button.ClickEvent event) {
    for (Map.Entry<String, String> entry : requiredParameters.entrySet()) {
      String newValue = table.getItem(entry.getKey()).getItemProperty("Value").getValue().toString();
      dashletSpec.getParameters().put(entry.getKey(), newValue);
    }
    WallboardProvider.getInstance().save();
    ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Properties");
    close();
  }
});

代码示例来源:origin: OpenNMS/opennms

/**
 * This method removes the given {@link DashletSpecEditor}.
 *
 * @param dashletSpecEditor the {@link DashletSpecEditor} to be removed
 */
public void removeDashletSpecEditor(DashletSpecEditor dashletSpecEditor) {
  m_verticalLayout.removeComponent(dashletSpecEditor);
  m_dashletSpecEditorMap.remove(dashletSpecEditor.getDashletSpec());
  m_wallboard.getDashletSpecs().remove(dashletSpecEditor.getDashletSpec());
  WallboardProvider.getInstance().save();
}

代码示例来源:origin: OpenNMS/opennms

/**
   * This method adds a given {@link DashletSpec}.
   *
   * @param dashletSpec the {@link DashletSpec} to be added
   */
  private void addDashletSpec(DashletSpec dashletSpec) {
    DashletSpecEditor dashletSpecEditor = new DashletSpecEditor(this, m_dashletSelector, dashletSpec);

    m_dashletSpecEditorMap.put(dashletSpec, dashletSpecEditor);

    m_verticalLayout.addComponent(dashletSpecEditor);

    if (!m_wallboard.getDashletSpecs().contains(dashletSpec)) {
      m_wallboard.getDashletSpecs().add(dashletSpec);

      WallboardProvider.getInstance().save();
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

@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();
  }
});

代码示例来源:origin: OpenNMS/opennms

@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();
  }
});

代码示例来源:origin: OpenNMS/opennms

/**
   * Method invoked when the view is entered.
   *
   * @param event the view change event
   */
  @Override
  public void enter(ViewChangeListener.ViewChangeEvent event) {
    LoggerFactory.getLogger(DashboardView.class).warn("enter(): " + event.getParameters());
    if (event.getParameters() != null) {
      Wallboard wallboard = WallboardProvider.getInstance().getWallboard(event.getParameters());
      if (wallboard != null) {
        setDashletSpecs(wallboard.getDashletSpecs());
      }
    }
  }
}

代码示例来源:origin: org.opennms.features.vaadin-dashlets/dashlet-charts

@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();
  }
});

代码示例来源:origin: org.opennms.features.vaadin-dashlets/dashlet-ksc

@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();
  }
});

代码示例来源:origin: OpenNMS/opennms

@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();
  }
});

代码示例来源:origin: OpenNMS/opennms

public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
    if (durationField.isValid()) {
      m_dashletSpec.setDuration(Integer.valueOf((String) valueChangeEvent.getProperty().getValue()));
      WallboardProvider.getInstance().save();
      ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Duration");
    }
  }
});

代码示例来源:origin: OpenNMS/opennms

public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
    if (boostDurationField.isValid()) {
      m_dashletSpec.setBoostDuration(Integer.valueOf((String) valueChangeEvent.getProperty().getValue()));
      WallboardProvider.getInstance().save();
      ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Duration");
    }
  }
});

代码示例来源:origin: OpenNMS/opennms

public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
    if (priorityField.isValid()) {
      m_dashletSpec.setPriority(Integer.valueOf((String) valueChangeEvent.getProperty().getValue()));
      WallboardProvider.getInstance().save();
      ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Priority");
    }
  }
});

代码示例来源:origin: OpenNMS/opennms

public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
    if (boostPriorityField.isValid()) {
      m_dashletSpec.setBoostPriority(Integer.valueOf((String) valueChangeEvent.getProperty().getValue()));
      WallboardProvider.getInstance().save();
      ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Priority");
    }
  }
});

代码示例来源:origin: OpenNMS/opennms

@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());
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

void refreshTable() {
    if (m_table != null) {
      m_beanItemContainer = WallboardProvider.getInstance().getBeanContainer();
      m_table.setContainerDataSource(m_beanItemContainer);
      m_table.setVisibleColumns(new Object[]{"title", "Edit", "Remove", "Preview", "Default"});
      m_table.setColumnHeader("title", "Title");
      m_table.sort();
      m_table.refreshRowCache();
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
    m_dashletSpec.setTitle((String) valueChangeEvent.getProperty().getValue());
    WallboardProvider.getInstance().save();
    ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Title");
  }
});

代码示例来源:origin: OpenNMS/opennms

public void textChange(FieldEvents.TextChangeEvent textChangeEvent) {
    AbstractTextField source = (AbstractTextField) textChangeEvent.getSource();
    source.setValue(textChangeEvent.getText());
    if (source.isValid()) {
      m_tab.setCaption(textChangeEvent.getText());
      m_wallboard.setTitle(textChangeEvent.getText());
      WallboardProvider.getInstance().save();
      ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Title");
    }
  }
});

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com