Package com.cxy.redisclient.dto

Examples of com.cxy.redisclient.dto.ContainerKeyInfo


  }

  private void deleteCotainer(Item item, boolean deleteSub) {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (item instanceof TreeItem)
      treeItem = (TreeItem) item;
    else
      treeItem = getTreeItemByTableItem((TableItem) item);

    parseContainer(treeItem, cinfo);

    service2.deleteContainer(cinfo.getId(), cinfo.getDb(),
        cinfo.getContainerStr(), deleteSub);

    if (item instanceof TableItem) {
      treeItem.dispose();
    }
    item.dispose();
View Full Code Here


  private void addFavorite() {
    TreeItem treeItem;
    String fullContainer;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem) {
      treeItem = (TreeItem) itemsSelected[0];
      fullContainer = text.getText();
    } else {
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);
      NodeType type = (NodeType) itemsSelected[0].getData(NODE_TYPE);
      if (type == NodeType.CONTAINER || type == NodeType.DATABASE)
        fullContainer = text.getText() + itemsSelected[0].getText()
            + ":";
      else
        fullContainer = text.getText() + itemsSelected[0].getText();
    }

    parseContainer(treeItem, cinfo);

    AddFavoriteDialog dialog = new AddFavoriteDialog(shell, iconImage,
        fullContainer);
    String name = (String) dialog.open();
    if (name != null)
      service3.add(cinfo.getId(), name, fullContainer);

    removeFavoriteMenuItem();
    addFavoriteMenuItem();
  }
View Full Code Here

  private void dbContainerTreeItemSelected(TreeItem itemSelected,
      boolean refresh) {
    itemsSelected = new Item[] { itemSelected };
    tree.setSelection(itemSelected);
    ContainerKeyInfo info = new ContainerKeyInfo();
    parseContainer(itemSelected, info);
    text.setText(getLocation(info));

    dbContainerItemSelected(itemSelected);

    NodeType type = (NodeType) itemSelected.getData(NODE_TYPE);
    if (!(type == NodeType.CONTAINER && flatView)) {
      Set<Node> cnodes = service2.listContainers(info.getId(),
          info.getDb(), info.getContainerStr(), flatView);

      if (itemSelected.getData(ITEM_OPENED) == null
          || ((Boolean) (itemSelected.getData(ITEM_OPENED)) == false)) {
        itemSelected.removeAll();
View Full Code Here

  }

  private void newString() {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem)
      treeItem = (TreeItem) itemsSelected[0];
    else
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);

    parseContainer(treeItem, cinfo);

    NewStringDialog dialog = new NewStringDialog(shell, iconImage,
        cinfo.getId(), cinfo.getServerName(), cinfo.getDb(),
        cinfo.getContainerStr());
    StringInfo info = (StringInfo) dialog.open();
    if (info != null) {
      service2.addString(cinfo.getId(), cinfo.getDb(), info.getKey(),
          info.getValue(), info.getTtl());

      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, false);
      gotoDBContainer(cinfo.getId(), cinfo.getDb(), info.getKey(), true,
          false);
    }

  }
View Full Code Here

  }

  private void newList() {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem)
      treeItem = (TreeItem) itemsSelected[0];
    else
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);

    parseContainer(treeItem, cinfo);

    NewListDialog dialog = new NewListDialog(shell, iconImage,
        cinfo.getId(), cinfo.getServerName(), cinfo.getDb(),
        cinfo.getContainerStr());
    ListInfo info = (ListInfo) dialog.open();
    if (info != null) {
      service4.add(cinfo.getId(), cinfo.getDb(), info.getKey(),
          info.getValues(), info.isHeadTail(), info.isExist(),
          info.getTtl());
      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, false);
      gotoDBContainer(cinfo.getId(), cinfo.getDb(), info.getKey(), true,
          false);
    }
  }
View Full Code Here

  }

  private void newSet() {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem)
      treeItem = (TreeItem) itemsSelected[0];
    else
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);

    parseContainer(treeItem, cinfo);

    NewSetDialog dialog = new NewSetDialog(shell, iconImage, cinfo.getId(),
        cinfo.getServerName(), cinfo.getDb(), cinfo.getContainerStr());
    SetInfo info = (SetInfo) dialog.open();
    if (info != null) {
      service5.add(cinfo.getId(), cinfo.getDb(), info.getKey(),
          info.getValues(), info.getTtl());
      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, false);
      gotoDBContainer(cinfo.getId(), cinfo.getDb(), info.getKey(), true,
          false);
    }
  }
View Full Code Here

  }

  private void newZSet() {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem)
      treeItem = (TreeItem) itemsSelected[0];
    else
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);

    parseContainer(treeItem, cinfo);

    NewZSetDialog dialog = new NewZSetDialog(shell, iconImage,
        cinfo.getId(), cinfo.getServerName(), cinfo.getDb(),
        cinfo.getContainerStr());
    ZSetInfo info = (ZSetInfo) dialog.open();
    if (info != null) {
      service6.add(cinfo.getId(), cinfo.getDb(), info.getKey(),
          info.getValues(), info.getTtl());
      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, false);
      gotoDBContainer(cinfo.getId(), cinfo.getDb(), info.getKey(), true,
          false);
    }

  }
View Full Code Here

  }

  private void newHash() {
    TreeItem treeItem;

    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (itemsSelected[0] instanceof TreeItem)
      treeItem = (TreeItem) itemsSelected[0];
    else
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);

    parseContainer(treeItem, cinfo);

    NewHashDialog dialog = new NewHashDialog(shell, iconImage,
        cinfo.getId(), cinfo.getServerName(), cinfo.getDb(),
        cinfo.getContainerStr());
    HashInfo info = (HashInfo) dialog.open();
    if (info != null) {
      service7.add(cinfo.getId(), cinfo.getDb(), info.getKey(),
          info.getValues(), info.getTtl());
      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, false);
      gotoDBContainer(cinfo.getId(), cinfo.getDb(), info.getKey(), true,
          false);
    }

  }
View Full Code Here

      else if (clientOrderBy == OrderBy.TYPE)
        table.setSortColumn(tblclmnType);
      else
        table.setSortColumn(tblclmnSize);

      ContainerKeyInfo info = new ContainerKeyInfo();
      parseContainer(items[0], info);

      updateOrder();
      updateOrderby();
View Full Code Here

    }
  }

  private void renameKey() {
    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    TreeItem[] items = tree.getSelection();

    parseContainer(items[0], cinfo);

    String key = cinfo.getContainerStr();
    key += itemsSelected[0].getText();

    RenameKeysDialog dialog = new RenameKeysDialog(shell, iconImage,
        cinfo.getServerName(), cinfo.getDb(), key);
    RenameInfo rinfo = (RenameInfo) dialog.open();

    if (rinfo != null) {
      boolean result = service2.renameKey(cinfo.getId(), cinfo.getDb(),
          key, rinfo.getNewContainer(), rinfo.isOverwritten());
      dbContainerTreeItemSelected(items[0], false);

      if (!rinfo.isOverwritten() && !result) {
        String failString = i18nFile.getText(I18nFile.RENAMEKEYFAIL);
View Full Code Here

TOP

Related Classes of com.cxy.redisclient.dto.ContainerKeyInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.