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));