gpt4 book ai didi

com.tc.admin.common.XObjectTableModel类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 22:51:05 25 4
gpt4 key购买 nike

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

XObjectTableModel介绍

暂无

代码示例

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void actionPerformed(ActionEvent ae) {
  stopCellEditing();
  standaloneCacheTableModel.clear();
  CacheManagerInstance cacheManagerInstance = (CacheManagerInstance) cacheManagerSelector.getSelectedItem();
  standaloneCacheTableModel.add(getSettingsList(cacheManagerInstance));
  standaloneCacheTableModel.fireTableDataChanged();
 }
});

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0

@Override
 public String getToolTipText(MouseEvent me) {
  int hitRowIndex = rowAtPoint(me.getPoint());
  int hitColIndex = columnAtPoint(me.getPoint());
  if (hitRowIndex != -1) {
   if (hitColIndex == 0) {
    CacheStatisticsModel crs = (CacheStatisticsModel) cacheTableModel.getObjectAt(hitRowIndex);
    return crs.getCacheName();
   } else if (hitColIndex > 1) {
    int sum = 0;
    for (int i = 0; i < cacheTableModel.getRowCount(); i++) {
     Number n = (Number) cacheTableModel.getValueAt(i, hitColIndex);
     sum += n.intValue();
    }
    return Integer.toString(sum) + " Total " + cacheTableModel.getColumnName(hitColIndex);
   }
  }
  return super.getToolTipText(me);
 }
};

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void clusteredCacheModelChanged(ClusteredCacheModel cacheModel) {
 for (int i = 0; i < clusteredCacheTableModel.getRowCount(); i++) {
  IMutableCacheSettings settings = (IMutableCacheSettings) clusteredCacheTableModel.getObjectAt(i);
  if (settings.getCacheName().equals(cacheModel.getCacheName())) {
   clusteredCacheTableModel.remove(i);
   clusteredCacheTableModel.add(i, cacheModel.getCacheSettings());
   clusteredCacheTableModel.fireTableRowsUpdated(i, i);
   break;
  }
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void clusteredCacheModelAdded(ClusteredCacheModel cacheModel) {
 clusteredCacheTableModel.add(cacheModel.getCacheSettings());
 clusteredCacheTableModel.sortColumn(0, XObjectTableModel.DOWN);
 clusteredCacheTableModel.fireTableDataChanged();
 evaluateVisibility();
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0-hibernate-ui

@Override
 protected void finished() {
  if (tornDown.get()) { return; }
  Exception e = getException();
  if (e != null) {
   appContext.log(ExceptionHelper.getRootCause(e));
  } else {
   Map<String, ? extends CacheRegionStats> result = getResult();
   regionTableModel.clear();
   if (result != null) {
    Iterator<String> iter = result.keySet().iterator();
    while (iter.hasNext()) {
     CacheRegionStats cacheRegionStats = result.get(iter.next());
     if (cacheRegionStats != null) {
      regionTableModel.add(cacheRegionStats);
     }
    }
    sortTable(regionTable);
   }
  }
  refreshRegionsButton.setEnabled(true);
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0

private int indexOf(CacheModel cacheModel) {
 int rowCount = cacheTableModel.getRowCount();
 for (int i = 0; i < rowCount; i++) {
  CacheStatisticsModel cacheStatisticsModel = (CacheStatisticsModel) cacheTableModel.getObjectAt(i);
  if (cacheStatisticsModel.getCacheName().equals(cacheModel.getCacheName())) { return i; }
 }
 return -1;
}

代码示例来源:origin: org.terracotta.modules/tim-hibernate-cache-provider-3.2

private void sortTable(final XObjectTable table) {
 table.sort();
 ((XObjectTableModel) table.getModel()).fireTableDataChanged();
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

@Override
 public void tearDown() {
  if (!tornDown.compareAndSet(false, true)) { return; }

  cacheManagerModel.removeCacheManagerModelListener(this);

  super.tearDown();

  synchronized (this) {
   cacheManagerModel = null;
   cacheTable = null;
   cacheTableModel.clear();
   cacheTableModel = null;
   refreshStatisticsAction = null;
   clearStatisticsAction = null;
  }
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void clusteredCacheModelRemoved(ClusteredCacheModel cacheModel) {
 for (int i = 0; i < clusteredCacheTableModel.getRowCount(); i++) {
  IMutableCacheSettings settings = (IMutableCacheSettings) clusteredCacheTableModel.getObjectAt(i);
  if (settings.getCacheName().equals(cacheModel.getCacheName())) {
   clusteredCacheTableModel.remove(i);
   clusteredCacheTableModel.fireTableRowsDeleted(i, i);
   break;
  }
 }
 evaluateVisibility();
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0

public void valueChanged(ListSelectionEvent e) {
 if (!e.getValueIsAdjusting()) {
  CacheModel cacheModel = null;
  int row = cacheTable.getSelectedRow();
  if (row != -1) {
   CacheStatisticsModel cacheStatisticsModel = (CacheStatisticsModel) cacheTableModel.getObjectAt(row);
   cacheModel = cacheManagerModel.getCacheModel(cacheStatisticsModel.getCacheName());
  }
  setSelectedCacheModel(cacheModel);
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

private XContainer createClusteredPanel() {
 clusteredCacheTableModel = new XObjectTableModel(IMutableCacheSettings.class, ATTRS, HEADERS);
 Iterator<ClusteredCacheModel> cacheModelIter = cacheManagerModel.clusteredCacheModelIterator();
 while (cacheModelIter.hasNext()) {
  clusteredCacheTableModel.add(cacheModelIter.next().getCacheSettings());
 }
 clusteredCacheTable = new SettingsTable(clusteredCacheTableModel);
 clusteredCacheTable.getColumnModel().getColumn(0).setCellRenderer(new CacheNameRenderer(true));
 clusteredCacheTable.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent e) {
   Point p = e.getPoint();
   int col = clusteredCacheTable.columnAtPoint(p);
   int row = clusteredCacheTable.rowAtPoint(p);
   if (col != -1 && row != -1) {
    clusteredCacheTable.editCellAt(row, col, null);
   }
  }
 });
 XScrollPane scroller = new XScrollPane(clusteredCacheTable);
 XContainer result = new XContainer(new BorderLayout());
 result.setBorder(BorderFactory.createTitledBorder("Terracotta-clustered Caches"));
 result.add(scroller);
 return result;
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-hibernate-ui

@Override
 protected void finished() {
  if (tornDown.get()) { return; }
  Exception e = getException();
  if (e != null) {
   appContext.log(ExceptionHelper.getRootCause(e));
  } else {
   Map<String, ? extends CacheRegionStats> result = getResult();
   regionTableModel.clear();
   if (result != null) {
    Iterator<String> iter = result.keySet().iterator();
    while (iter.hasNext()) {
     CacheRegionStats cacheRegionStats = result.get(iter.next());
     if (cacheRegionStats != null) {
      regionTableModel.add(cacheRegionStats);
     }
    }
    sortTable(regionTable);
   }
  }
  refreshRegionsButton.setEnabled(true);
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void standaloneCacheModelChanged(StandaloneCacheModel cacheModel) {
  CacheModelInstance cacheModelInstance = cacheModel.cacheModelInstance();
  CacheManagerInstance cacheManagerInstance = cacheModelInstance.getCacheManagerInstance();
  List<IMutableCacheSettings> settingsList = getSettingsList(cacheManagerInstance);
  for (int i = 0; i < settingsList.size(); i++) {
   IMutableCacheSettings settings = settingsList.get(i);
   if (settings.getCacheName().equals(cacheModel.getCacheName())) {
    settingsList.set(i, settings);
    break;
   }
  }

  if (cacheManagerInstance.equals(cacheManagerSelector.getSelectedItem())) {
   for (int i = 0; i < standaloneCacheTableModel.getRowCount(); i++) {
    IMutableCacheSettings settings = (IMutableCacheSettings) standaloneCacheTableModel.getObjectAt(i);
    if (settings.getCacheName().equals(cacheModel.getCacheName())) {
     standaloneCacheTableModel.remove(i);
     standaloneCacheTableModel.add(i, cacheModel.getCacheSettings());
     standaloneCacheTableModel.fireTableRowsUpdated(i, i);
     break;
    }
   }
  }
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

private int indexOf(CacheModel cacheModel) {
 int rowCount = cacheTableModel.getRowCount();
 for (int i = 0; i < rowCount; i++) {
  CacheStatisticsModel cacheStatisticsModel = (CacheStatisticsModel) cacheTableModel.getObjectAt(i);
  if (cacheStatisticsModel.getCacheName().equals(cacheModel.getCacheName())) { return i; }
 }
 return -1;
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-hibernate-ui

private void sortTable(final XObjectTable table) {
 table.sort();
 ((XObjectTableModel) table.getModel()).fireTableDataChanged();
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-hibernate-ui

tabbedPane = null;
entityTable = null;
entityTableModel.clear();
entityTableModel = null;
refreshEntitiesButton = null;
collectionTable = null;
collectionTableModel.clear();
collectionTableModel = null;
refreshCollectionsButton = null;
queryTable = null;
queryTableModel.clear();
queryTableModel = null;
refreshQueriesButton = null;

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void standaloneCacheModelRemoved(StandaloneCacheModel cacheModel) {
 CacheModelInstance cacheModelInstance = cacheModel.cacheModelInstance();
 CacheManagerInstance cacheManagerInstance = cacheModelInstance.getCacheManagerInstance();
 removeStandaloneCacheSettings(cacheManagerInstance, cacheModel);
 if (cacheManagerInstance.equals(cacheManagerSelector.getSelectedItem())) {
  for (int i = 0; i < standaloneCacheTableModel.getRowCount(); i++) {
   IMutableCacheSettings settings = (IMutableCacheSettings) standaloneCacheTableModel.getObjectAt(i);
   if (settings.getCacheName().equals(cacheModel.getCacheName())) {
    standaloneCacheTableModel.remove(i);
    standaloneCacheTableModel.fireTableRowsDeleted(i, i);
    break;
   }
  }
 }
 evaluateVisibility();
 // If the settingsList is now null, there are no more standalone caches in the containing
 // CacheManagerInstance, so update the selector model so the CacheManagerInstance is removed.
 List<IMutableCacheSettings> settingsList = standaloneCacheSettings.get(cacheManagerInstance);
 if (settingsList == null) {
  updateCacheManageSelector();
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void standaloneCacheModelAdded(StandaloneCacheModel cacheModel) {
 CacheModelInstance cacheModelInstance = cacheModel.cacheModelInstance();
 CacheManagerInstance cacheManagerInstance = cacheModelInstance.getCacheManagerInstance();
 boolean haveCacheManagerInstance = haveCacheManagerInstance(cacheManagerInstance);
 List<IMutableCacheSettings> settingsList = getSettingsList(cacheManagerInstance);
 // If we already have CacheManagerInstance in the selector model, then we need to update the settingsList
 // here, else getSettingsList properly set everything up already.
 if (haveCacheManagerInstance) {
  settingsList.add(cacheModel.getCacheSettings());
  sort(settingsList);
 }
 // If we didn't already have CacheManagerInstance in the selector model, update the selector model.
 if (!haveCacheManagerInstance) {
  updateCacheManageSelector();
 } else if (cacheManagerInstance.equals(cacheManagerSelector.getSelectedItem())) {
  standaloneCacheTableModel.add(cacheModel.getCacheSettings());
  standaloneCacheTableModel.sortColumn(0, XObjectTableModel.DOWN);
  standaloneCacheTableModel.fireTableDataChanged();
 }
 evaluateVisibility();
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

public void valueChanged(ListSelectionEvent e) {
 if (!e.getValueIsAdjusting()) {
  CacheModel cacheModel = null;
  int row = cacheTable.getSelectedRow();
  if (row != -1) {
   CacheStatisticsModel cacheStatisticsModel = (CacheStatisticsModel) cacheTableModel.getObjectAt(row);
   cacheModel = cacheManagerModel.getCacheModel(cacheStatisticsModel.getCacheName());
  }
  setSelectedCacheModel(cacheModel);
 }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0-hibernate-ui

@Override
 public String getToolTipText(MouseEvent me) {
  int hitRowIndex = rowAtPoint(me.getPoint());
  int hitColIndex = columnAtPoint(me.getPoint());
  if (hitRowIndex != -1) {
   if (hitColIndex == 0) {
    EntityStats es = (EntityStats) entityTableModel.getObjectAt(hitRowIndex);
    return es.getName();
   } else {
    int sum = 0;
    for (int i = 0; i < entityTableModel.getRowCount(); i++) {
     Number n = (Number) entityTableModel.getValueAt(i, hitColIndex);
     sum += n.intValue();
    }
    return Integer.toString(sum) + " Total " + entityTableModel.getColumnName(hitColIndex);
   }
  }
  return super.getToolTipText(me);
 }
};

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