private void dataProperties() {
TableItem[] items = table.getSelection();
NodeType type = (NodeType) items[0].getData(NODE_TYPE);
TreeItem treeItem = getTreeItemByTableItem(items[0]);
ContainerKeyInfo cinfo = new ContainerKeyInfo();
parseContainer(treeItem, cinfo);
String key = cinfo.getContainerStr() + items[0].getText();
if (!service2.isKeyExist(cinfo.getId(), cinfo.getDb(), key))
throw new KeyNotExistException(cinfo.getId(), cinfo.getDb(), key);
if (!openDataContent.isOpen(cinfo.getId(), cinfo.getDb(), key)) {
final CTabItem tbtmNewItem = new CTabItem(tabFolder_1, SWT.NONE);
tbtmNewItem.setText("New Item");
tbtmNewItem.setShowClose(true);
Composite composite_2 = new Composite(tabFolder_1, SWT.NONE);
tbtmNewItem.setControl(composite_2);
composite_2.setLayout(new GridLayout(1, false));
tbtmNewItem.setText(key);
tbtmNewItem.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
DataContent dataContent = (DataContent) tbtmNewItem
.getData();
openDataContent.remove(dataContent);
tbtmNewItem.dispose();
}
});
DataContent content = null;
if (type == NodeType.STRING) {
tbtmNewItem.setImage(strImage);
content = new StringDataContent(tbtmNewItem, iconImage, cinfo.getId(),
cinfo.getServerName(), cinfo.getDb(), key,
I18nFile.STRING);
} else if (type == NodeType.HASH) {
tbtmNewItem.setImage(hashImage);
content = new HashDataContent(tbtmNewItem, iconImage, cinfo.getId(),
cinfo.getServerName(), cinfo.getDb(), key,
I18nFile.HASH);
} else if (type == NodeType.LIST) {
tbtmNewItem.setImage(listImage);
content = new ListDataContent(tbtmNewItem, iconImage, cinfo.getId(),
cinfo.getServerName(), cinfo.getDb(), key,
I18nFile.LIST);
} else if (type == NodeType.SET) {
tbtmNewItem.setImage(setImage);
content = new SetDataContent(tbtmNewItem, iconImage, cinfo.getId(),
cinfo.getServerName(), cinfo.getDb(), key, I18nFile.SET);
} else if (type == NodeType.SORTEDSET) {
tbtmNewItem.setImage(zsetImage);
content = new ZSetDataContent(tbtmNewItem, iconImage, cinfo.getId(),
cinfo.getServerName(), cinfo.getDb(), key,
I18nFile.ZSET);
}
content.setShell(composite_2);
content.initContents();
openDataContent.add(content);
tabFolder_1.setSelection(tbtmNewItem);
} else {
tabFolder_1.setSelection(openDataContent.getTabItem(cinfo.getId(),
cinfo.getDb(), key));
}
}