gpt4 book ai didi

org.opennms.features.vaadin.dashboard.config.ui.WallboardProvider类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 19:47:05 28 4
gpt4 key购买 nike

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

WallboardProvider介绍

[英]This class is used for loading, holding and saving of Wallboard definitions.
[中]此类用于加载、保存和保存墙板定义。

代码示例

代码示例来源: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
  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

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

代码示例来源: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 containerItemSetChange(Container.ItemSetChangeEvent itemSetChangeEvent) {
    List<Wallboard> wallboardsToRemove = new ArrayList<>();
    List<TabSheet.Tab> tabsToRemove = new ArrayList<>();
    for (Map.Entry<Wallboard, TabSheet.Tab> entry : m_wallboardEditorMap.entrySet()) {
      WallboardEditor wallboardEditor = (WallboardEditor) entry.getValue().getComponent();
      if (!WallboardProvider.getInstance().containsWallboard(wallboardEditor.getWallboard())) {
        wallboardsToRemove.add(wallboardEditor.getWallboard());
        tabsToRemove.add(entry.getValue());
      }
    }
    for (TabSheet.Tab tab : tabsToRemove) {
      m_tabSheet.removeTab(tab);
    }
    for (Wallboard wallboard : wallboardsToRemove) {
      m_wallboardEditorMap.remove(wallboard);
    }
  }
});

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

WallboardProvider.getInstance().getBeanContainer().addItemSetChangeListener(new Container.ItemSetChangeListener() {
  public void containerItemSetChange(Container.ItemSetChangeEvent itemSetChangeEvent) {
    List<Wallboard> wallboardsToRemove = new ArrayList<>();

代码示例来源: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

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

代码示例来源: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

BeanItemContainer<Wallboard> beanItemContainer = WallboardProvider.getInstance().getBeanContainer();

代码示例来源: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: 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

m_nativeSelect.setContainerDataSource(WallboardProvider.getInstance().getBeanContainer());
m_nativeSelect.setItemCaptionPropertyId("title");
m_nativeSelect.setNullSelectionAllowed(false);

代码示例来源: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

@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("criteria", criteriaBuilderComponent.getCriteria());
    m_dashletSpec.getParameters().put("boostSeverity", String.valueOf(m_boostedSeveritySelect.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

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) {
    m_dashletSpec.setTitle((String) valueChangeEvent.getProperty().getValue());
    WallboardProvider.getInstance().save();
    ((WallboardConfigUI) getUI()).notifyMessage("Data saved", "Title");
  }
});

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