Tabnine Logo
Item.getData
Code IndexAdd Tabnine to your IDE (free)

How to use
getData
method
in
org.eclipse.swt.widgets.Item

Best Java code snippets using org.eclipse.swt.widgets.Item.getData (Showing top 20 results out of 576)

origin: caoxinyu/RedisClient

private TableItem findContainerTableItem() {
  for (Item item : itemsSelected) {
    NodeType type = (NodeType) item.getData(NODE_TYPE);
    if (type == NodeType.CONTAINER)
      return (TableItem) item;
  }
  return null;
}
origin: caoxinyu/RedisClient

  @Override
  public void widgetSelected(SelectionEvent e) {
    if (itemsSelected[0] instanceof TreeItem) {
      deleteOneContainer();
    } else {
      if (itemsSelected.length == 1) {
        NodeType type = (NodeType) itemsSelected[0]
            .getData(NODE_TYPE);
        if (type == NodeType.CONTAINER) {
          deleteOneContainer();
        } else {
          deleteOneKey();
        }
      } else if (itemsSelected.length > 1) {
        deleteKeys();
      }
    }
  }
});
origin: caoxinyu/RedisClient

  @Override
  public void widgetSelected(SelectionEvent e) {
    NodeType type = (NodeType) itemsSelected[0].getData(NODE_TYPE);
    if (type == NodeType.CONTAINER || type == NodeType.DATABASE)
      dbContainerProperties();
    else
      dataProperties();
  }
});
origin: caoxinyu/RedisClient

private void removeOneServer(Item item) {
  int id = ((Integer) (item.getData(NODE_ID))).intValue();
  service1.delete(id);
  if (item instanceof TableItem) {
    getTreeItemByTableItem((TableItem) item).dispose();
  }
  item.dispose();
}
origin: caoxinyu/RedisClient

private void serverProperties() {
  int id = (Integer) itemsSelected[0].getData(NODE_ID);
  Server info = service1.listById(id);
  Map<String, String[]> values = service1.listInfo(id);
  PropertiesDialog dialog = new PropertiesDialog(shell, iconImage, info,
      values);
  dialog.open();
}
origin: caoxinyu/RedisClient

private void exportOne(ContainerKeyInfo cinfo, String file, Item item) {
  ContainerKey containerKey = cinfo.getContainer();
  
  if (item instanceof TableItem) {
    NodeType type = (NodeType) item.getData(NODE_TYPE);
    if (type != NodeType.CONTAINER && type != NodeType.DATABASE) {
      String con = containerKey == null ? "" : containerKey
          .getContainerKey();
      containerKey = new ContainerKey(con + item.getText());
    }
  }
  ExportService service = new ExportService(file, cinfo.getId(),
      cinfo.getDb(), containerKey);
  try {
    service.export();
  } catch (IOException e) {
    throw new RuntimeException(e.getMessage());
  }
}
origin: caoxinyu/RedisClient

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();
}
origin: caoxinyu/RedisClient

private void publish() {
  int id = (Integer) itemsSelected[0].getData(NODE_ID);
  
  if(!openPublish.isOpen(id)){
    final Publish publish = new Publish(tabFolder_1, id);
    CTabItem  tabItem = publish.init();
    openPublish.add(publish);
    tabItem.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        openPublish.remove(publish);
      }
    });
  }else
    tabFolder_1.setSelection(openPublish.getTabItem(id));
}

origin: caoxinyu/RedisClient

private void console() {
  int id = (Integer) itemsSelected[0].getData(NODE_ID);
  if(!openConsole.isOpen(id)){
    final Console console = new Console(tabFolder_1, id);
    CTabItem  tabItem = console.init();
    openConsole.add(console);
    
    tabItem.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        openConsole.remove(console);
      }
    });
  }else
    tabFolder_1.setSelection(openConsole.getTabItem(id));
    
}

origin: caoxinyu/RedisClient

  private void subscribe() {
    int id = (Integer) itemsSelected[0].getData(NODE_ID);
    
    if(!openSubscribe.isOpen(id)){
      final Subscribe subscribe = new Subscribe(tabFolder_1, id);
      CTabItem  tabItem = subscribe.init();
      openSubscribe.add(subscribe);
      tabItem.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          openSubscribe.remove(subscribe);
        }
      });
    }else
      tabFolder_1.setSelection(openSubscribe.getTabItem(id));
    
  }
}
origin: caoxinyu/RedisClient

private void deleteKeys() {
  TableItem containerItem = findContainerTableItem();
  DeleteContainerDialog dialog = new DeleteContainerDialog(shell,
      iconImage, questionImage, containerItem == null ? 0 : -1);
  Boolean deleteSub = (Boolean) dialog.open();
  if (deleteSub != null) {
    TreeItem treeItem = null;
    if (containerItem != null)
      treeItem = getTreeItemByTableItem(containerItem)
          .getParentItem();
    for (Item item : itemsSelected) {
      NodeType type = (NodeType) item.getData(NODE_TYPE);
      if (type == NodeType.CONTAINER) {
        deleteCotainer(item, deleteSub);
      } else {
        deleteKey(item);
      }
    }
    if (containerItem != null) {
      treeItem.setData(ITEM_OPENED, false);
      dbContainerTreeItemSelected(treeItem, true);
    }
  }
}
origin: caoxinyu/RedisClient

private void copy() {
  pBuffer = new PasteBuffer();
  for (Item item : itemsSelected) {
    TreeItem treeItem;
    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (item instanceof TreeItem) {
      treeItem = (TreeItem) item;
    } else {
      treeItem = getTreeItemByTableItem((TableItem) item);
    }
    parseContainer(treeItem, cinfo);
    if (item instanceof TreeItem)
      pBuffer.copy(cinfo);
    else {
      NodeType type = (NodeType) item.getData(NODE_TYPE);
      if (type == NodeType.CONTAINER || type == NodeType.DATABASE)
        pBuffer.copy(cinfo);
      else {
        cinfo.setContainer(cinfo.getContainer(), item.getText());
        pBuffer.copy(cinfo);
      }
    }
  }
}
origin: caoxinyu/RedisClient

private void cut() {
  pBuffer = new PasteBuffer();
  for (Item item : itemsSelected) {
    TreeItem treeItem;
    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    if (item instanceof TreeItem) {
      treeItem = (TreeItem) item;
    } else {
      treeItem = getTreeItemByTableItem((TableItem) item);
    }
    parseContainer(treeItem, cinfo);
    if (item instanceof TreeItem)
      pBuffer.cut(cinfo, treeItem);
    else {
      NodeType type = (NodeType) item.getData(NODE_TYPE);
      if (type == NodeType.CONTAINER || type == NodeType.DATABASE)
        pBuffer.cut(cinfo, treeItem);
      else {
        cinfo.setContainer(cinfo.getContainer(), item.getText());
        pBuffer.cut(cinfo, treeItem);
      }
    }
  }
}
origin: caoxinyu/RedisClient

private void updateServer() {
  int id = (Integer) itemsSelected[0].getData(NODE_ID);
  Server server = service1.listById(id);
  UpdateServerDialog dialog = new UpdateServerDialog(shell, iconImage,
      server);
  server = (Server) dialog.open();
  if (server != null) {
    service1.update(id, server.getName(), server.getHost(),
        server.getPort(), server.getPassword());
    TreeItem treeItem = null;
    if (itemsSelected[0] instanceof TableItem) {
      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);
      itemsSelected[0].setText(server.getName());
    } else
      treeItem = (TreeItem) itemsSelected[0];
    treeItem.setText(server.getName());
    serverTreeItemSelected(treeItem, true);
  }
}
origin: caoxinyu/RedisClient

itemsSelected = treeItems;
NodeType type = (NodeType) itemsSelected[0].getData(NODE_TYPE);
switch (type) {
case SERVER:
origin: caoxinyu/RedisClient

menuServer.getItem(3).setEnabled(false);
NodeType type = (NodeType) itemSelected.getData(NODE_TYPE);
origin: inspectIT/inspectIT

/**
 * Gets {@link #data}.
 *
 * @return {@link #data}
 */
public Object getData() {
  return getItem().getData();
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public void modify(Object element, String property, Object value) {
  if (element instanceof Item)
    element = ((Item) element).getData();
  ((InterfaceWrapper) element).interfaceName= (String) value;
  fSuperInterfacesDialogField.elementChanged((InterfaceWrapper) element);
}
@Override
origin: org.eclipse/org.eclipse.wst.xml.ui

public void modify(Object element, String property, Object value) {
  // enableNodeSelectionListener(false);
  Item item = (Item) element;
  String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
  String newValue = value.toString();
  if ((newValue != null) && !newValue.equals(oldValue)) {
    treeContentHelper.setNodeValue((Node) item.getData(), value.toString());
  }
  // enableNodeSelectionListener(true);
}
origin: org.eclipse.platform/org.eclipse.jface

@Override
protected Widget doFindItem(Object element) {
  Item[] children = doGetItems();
  for (Item item : children) {
    Object data = item.getData();
    if (data != null && equals(data, element)) {
      return item;
    }
  }
  return null;
}
org.eclipse.swt.widgetsItemgetData

Popular methods of Item

  • setImage
    Sets the receiver's image to the argument, which may be null indicating that no image should be disp
  • getText
    Returns the receiver's text, which will be an empty string if it has never been set.
  • setText
    Sets the receiver's text. Note: If control characters like '\n', '\t' etc. are used in the string, t
  • dispose
  • isDisposed
  • setData
  • getImage
    Returns the receiver's image if it has one, or null if it does not.
  • checkWidget
  • getNameText
  • releaseParent
  • releaseWidget
  • reskinChildren
  • releaseWidget,
  • reskinChildren,
  • error,
  • releaseChildren,
  • releaseHandle,
  • deregister,
  • destroyWidget,
  • register,
  • release

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now