super(parentShell);
this.selection = selection;
this.project = project;
if (this.selection != null && this.selection instanceof TextSelection){
TextSelection ts = (TextSelection)this.selection;
this.setTypeName(ts.getText());
} else if (this.selection != null && this.selection instanceof TreeSelection){
TreeSelection ts = (TreeSelection)this.selection;
Object element = ts.getFirstElement();
if (element instanceof ToolAttribute){
this.setTypeName(((ToolAttribute)element).getType());
} else if (element instanceof ToolVirtualAttribute){
this.setTypeName(((ToolAttribute)element).getType());
} else {
this.setTypeName(ts.getFirstElement().toString());
}
}
}