Program: 102006
Project: 102006
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void createPanel(Composite parent){
  final String DATA_POLICY_COLUMN_NAME=i18n("String_Node_Str");
  final ButtonProvider editProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.EDIT_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return (selection.size() == 1);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      DataRole dataRole=(DataRole)selection.getFirstElement();
      if (dataRole == null) {
        return;
      }
      ContainerImpl tempContainer=null;
      try {
        Collection<File> modelFiles=vdbEditor.getVdb().getModelFiles();
        tempContainer=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
        ModelEditorImpl.setContainer(tempContainer);
        for (        File modelFile : modelFiles) {
          boolean isVisible=true;
          Resource r=tempContainer.getResource(URI.createFileURI(modelFile.getPath()),true);
          if (isVisible && ModelUtil.isModelFile(r) && !ModelUtil.isXsdFile(r)) {
            EObject firstEObj=r.getContents().get(0);
            ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
            String mmURI=ma.getPrimaryMetamodelUri();
            if (RelationalPackage.eNS_URI.equalsIgnoreCase(mmURI) || XmlDocumentPackage.eNS_URI.equalsIgnoreCase(mmURI) || WEB_SERVICES_VIEW_MODEL_URI.equalsIgnoreCase(mmURI)|| ModelIdentifier.FUNCTION_MODEL_URI.equals(mmURI)) {
            }
 else {
              tempContainer.getResources().remove(r);
            }
          }
 else {
            tempContainer.getResources().remove(r);
          }
        }
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
 finally {
        ModelEditorImpl.setContainer(null);
      }
      DataRole dataPolicy=new DataRole(dataRole.getName(),dataRole.getDescription(),dataRole.isAnyAuthenticated(),dataRole.isAllowCreateTempTables(),dataRole.isGrantAll(),dataRole.getRoleNames(),dataRole.getPermissions());
      final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
      Set<String> roleNames=VdbUtil.getDataRoleNames(vdbEditor.getVdb(),dataRole.getName());
      final DataRoleWizard wizard=new DataRoleWizard(tempContainer,dataPolicy,vdbEditor.getVdb().getAllowedLanguages(),roleNames);
      wizard.init(iww.getWorkbench(),new StructuredSelection(vdbEditor.getVdb().getModelEntries()));
      final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
      final int rc=dialog.open();
      if (rc == Window.OK) {
        DataRole dp=wizard.getFinalDataRole();
        if (dp != null) {
          vdbEditor.getVdb().removeDataRole(dataRole.getName());
          vdbEditor.getVdb().addDataRole(dp);
        }
      }
    }
  }
;
  dataRolesGroup=new TableAndToolBar(parent,1,new DefaultTableProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultTableProvider#doubleClicked(java.lang.Object)
 */
    @Override public void doubleClicked(    DataRole element){
      editProvider.selected(new StructuredSelection(element));
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.TableProvider#getElements()
 */
    @Override public DataRole[] getElements(){
      final Collection<DataRole> entries=vdbEditor.getVdb().getDataRoles();
      return entries.toArray(new DataRole[entries.size()]);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultTableProvider#isDoubleClickSupported()
 */
    @Override public boolean isDoubleClickSupported(){
      return true;
    }
  }
,new TextColumnProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#getImage(java.lang.Object)
 */
    @Override public Image getImage(    final DataRole element){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getName()
 */
    @Override public String getName(){
      return DATA_POLICY_COLUMN_NAME;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getImage()
 */
    @Override public Image getImage(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getValue(java.lang.Object)
 */
    @Override public String getValue(    final DataRole element){
      return element.getName();
    }
  }
,new TextColumnProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getName()
 */
    @Override public String getName(){
      return DESCRIPTION_COLUMN_NAME;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getImage()
 */
    @Override public Image getImage(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getValue(java.lang.Object)
 */
    @Override public String getValue(    final DataRole element){
      return element.getDescription();
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#isEditable(java.lang.Object)
 */
    @Override public boolean isEditable(    final DataRole element){
      return true;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#setValue(java.lang.Object,java.lang.Object)
 */
    @Override public void setValue(    final DataRole element,    final String value){
      element.setDescription(value);
    }
  }
);
  ButtonProvider newProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.ADD_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return true;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      ContainerImpl tempContainer=null;
      try {
        Collection<File> modelFiles=vdbEditor.getVdb().getModelFiles();
        tempContainer=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
        ModelEditorImpl.setContainer(tempContainer);
        for (        File modelFile : modelFiles) {
          boolean isVisible=true;
          Resource r=tempContainer.getResource(URI.createFileURI(modelFile.getPath()),true);
          if (isVisible && ModelUtil.isModelFile(r) && !ModelUtil.isXsdFile(r)) {
            EObject firstEObj=r.getContents().get(0);
            ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
            String mmURI=ma.getPrimaryMetamodelUri();
            if (RelationalPackage.eNS_URI.equalsIgnoreCase(mmURI) || XmlDocumentPackage.eNS_URI.equalsIgnoreCase(mmURI) || WEB_SERVICES_VIEW_MODEL_URI.equalsIgnoreCase(mmURI)|| ModelIdentifier.FUNCTION_MODEL_URI.equals(mmURI)) {
            }
 else {
              tempContainer.getResources().remove(r);
            }
          }
 else {
            tempContainer.getResources().remove(r);
          }
        }
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
 finally {
        ModelEditorImpl.setContainer(null);
      }
      final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
      Set<String> roleNames=VdbUtil.getDataRoleNames(vdbEditor.getVdb(),null);
      final DataRoleWizard wizard=new DataRoleWizard(tempContainer,null,vdbEditor.getVdb().getAllowedLanguages(),roleNames);
      wizard.init(iww.getWorkbench(),new StructuredSelection(vdbEditor.getVdb().getModelEntries()));
      final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
      final int rc=dialog.open();
      if (rc == Window.OK) {
        DataRole dp=wizard.getFinalDataRole();
        if (dp != null) {
          vdbEditor.getVdb().addDataRole(dp);
        }
      }
    }
  }
;
  dataRolesGroup.add(newProvider);
  dataRolesGroup.add(editProvider);
  ButtonProvider removeProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.REMOVE_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return !selection.isEmpty();
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      if (ConfirmationDialog.confirm(CONFIRM_REMOVE_MESSAGE)) {
        for (        final Object element : selection.toList()) {
          if (element instanceof DataRole) {
            vdbEditor.getVdb().removeDataRole(((DataRole)element).getName());
          }
        }
      }
    }
  }
;
  dataRolesGroup.add(removeProvider);
  dataRolesGroup.setInput(vdbEditor.getVdb());
  this.cloneDataRoleAction=new Action(i18n("String_Node_Str")){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.action.Action#run()
 */
    @Override public void run(){
      if (selectedDataRole != null) {
        DataRole newDR=new DataRole(selectedDataRole.getName() + i18n("String_Node_Str"),selectedDataRole.getDescription(),selectedDataRole.isAnyAuthenticated(),selectedDataRole.isAllowCreateTempTables(),selectedDataRole.isGrantAll(),selectedDataRole.getRoleNames(),selectedDataRole.getPermissions());
        vdbEditor.getVdb().addDataRole(newDR);
        dataRolesGroup.getTable().getViewer().refresh();
      }
    }
  }
;
  this.cloneDataRoleAction.setEnabled(true);
  final TableViewer dataRolesViewer=dataRolesGroup.getTable().getViewer();
  final MenuManager dataRolesMenuManager=new MenuManager();
  dataRolesViewer.getControl().setMenu(dataRolesMenuManager.createContextMenu(parent));
  dataRolesViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
 */
    @Override public void selectionChanged(    final SelectionChangedEvent event){
      dataRolesMenuManager.removeAll();
      IStructuredSelection sel=(IStructuredSelection)dataRolesViewer.getSelection();
      if (sel.size() == 1) {
        selectedDataRole=(DataRole)sel.getFirstElement();
        dataRolesMenuManager.add(cloneDataRoleAction);
      }
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void createPanel(Composite parent){
  final String DATA_POLICY_COLUMN_NAME=i18n("String_Node_Str");
  final ButtonProvider editProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.EDIT_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return (selection.size() == 1);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      DataRole dataRole=(DataRole)selection.getFirstElement();
      if (dataRole == null) {
        return;
      }
      ContainerImpl tempContainer=null;
      try {
        Collection<File> modelFiles=vdbEditor.getVdb().getModelFiles();
        tempContainer=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
        ModelEditorImpl.setContainer(tempContainer);
        for (        File modelFile : modelFiles) {
          boolean isVisible=true;
          Resource r=tempContainer.getResource(URI.createFileURI(modelFile.getPath()),true);
          if (isVisible && ModelUtil.isModelFile(r) && !ModelUtil.isXsdFile(r)) {
            EObject firstEObj=r.getContents().get(0);
            ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
            String mmURI=ma.getPrimaryMetamodelUri();
            if (RelationalPackage.eNS_URI.equalsIgnoreCase(mmURI) || XmlDocumentPackage.eNS_URI.equalsIgnoreCase(mmURI) || WEB_SERVICES_VIEW_MODEL_URI.equalsIgnoreCase(mmURI)|| ModelIdentifier.FUNCTION_MODEL_URI.equals(mmURI)) {
            }
 else {
              tempContainer.getResources().remove(r);
            }
          }
 else {
            tempContainer.getResources().remove(r);
          }
        }
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
 finally {
        ModelEditorImpl.setContainer(null);
      }
      final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
      Set<String> roleNames=VdbUtil.getDataRoleNames(vdbEditor.getVdb(),dataRole.getName());
      final DataRoleWizard wizard=new DataRoleWizard(tempContainer,dataRole,vdbEditor.getVdb().getAllowedLanguages(),roleNames);
      wizard.init(iww.getWorkbench(),new StructuredSelection(vdbEditor.getVdb().getModelEntries()));
      final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
      final int rc=dialog.open();
      if (rc == Window.OK) {
        DataRole dp=wizard.getFinalDataRole();
        if (dp != null) {
          vdbEditor.getVdb().removeDataRole(dataRole.getName());
          vdbEditor.getVdb().addDataRole(dp);
        }
      }
    }
  }
;
  dataRolesGroup=new TableAndToolBar(parent,1,new DefaultTableProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultTableProvider#doubleClicked(java.lang.Object)
 */
    @Override public void doubleClicked(    DataRole element){
      editProvider.selected(new StructuredSelection(element));
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.TableProvider#getElements()
 */
    @Override public DataRole[] getElements(){
      final Collection<DataRole> entries=vdbEditor.getVdb().getDataRoles();
      return entries.toArray(new DataRole[entries.size()]);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultTableProvider#isDoubleClickSupported()
 */
    @Override public boolean isDoubleClickSupported(){
      return true;
    }
  }
,new TextColumnProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#getImage(java.lang.Object)
 */
    @Override public Image getImage(    final DataRole element){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getName()
 */
    @Override public String getName(){
      return DATA_POLICY_COLUMN_NAME;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getImage()
 */
    @Override public Image getImage(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getValue(java.lang.Object)
 */
    @Override public String getValue(    final DataRole element){
      return element.getName();
    }
  }
,new TextColumnProvider<DataRole>(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getName()
 */
    @Override public String getName(){
      return DESCRIPTION_COLUMN_NAME;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getImage()
 */
    @Override public Image getImage(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.ColumnProvider#getValue(java.lang.Object)
 */
    @Override public String getValue(    final DataRole element){
      return element.getDescription();
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#isEditable(java.lang.Object)
 */
    @Override public boolean isEditable(    final DataRole element){
      return true;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.table.DefaultColumnProvider#setValue(java.lang.Object,java.lang.Object)
 */
    @Override public void setValue(    final DataRole element,    final String value){
      element.setDescription(value);
    }
  }
);
  ButtonProvider newProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.ADD_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return true;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      ContainerImpl tempContainer=null;
      try {
        Collection<File> modelFiles=vdbEditor.getVdb().getModelFiles();
        tempContainer=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
        ModelEditorImpl.setContainer(tempContainer);
        for (        File modelFile : modelFiles) {
          boolean isVisible=true;
          Resource r=tempContainer.getResource(URI.createFileURI(modelFile.getPath()),true);
          if (isVisible && ModelUtil.isModelFile(r) && !ModelUtil.isXsdFile(r)) {
            EObject firstEObj=r.getContents().get(0);
            ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
            String mmURI=ma.getPrimaryMetamodelUri();
            if (RelationalPackage.eNS_URI.equalsIgnoreCase(mmURI) || XmlDocumentPackage.eNS_URI.equalsIgnoreCase(mmURI) || WEB_SERVICES_VIEW_MODEL_URI.equalsIgnoreCase(mmURI)|| ModelIdentifier.FUNCTION_MODEL_URI.equals(mmURI)) {
            }
 else {
              tempContainer.getResources().remove(r);
            }
          }
 else {
            tempContainer.getResources().remove(r);
          }
        }
      }
 catch (      CoreException e) {
        e.printStackTrace();
      }
 finally {
        ModelEditorImpl.setContainer(null);
      }
      final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
      Set<String> roleNames=VdbUtil.getDataRoleNames(vdbEditor.getVdb(),null);
      final DataRoleWizard wizard=new DataRoleWizard(tempContainer,null,vdbEditor.getVdb().getAllowedLanguages(),roleNames);
      wizard.init(iww.getWorkbench(),new StructuredSelection(vdbEditor.getVdb().getModelEntries()));
      final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
      final int rc=dialog.open();
      if (rc == Window.OK) {
        DataRole dp=wizard.getFinalDataRole();
        if (dp != null) {
          vdbEditor.getVdb().addDataRole(dp);
        }
      }
    }
  }
;
  dataRolesGroup.add(newProvider);
  dataRolesGroup.add(editProvider);
  ButtonProvider removeProvider=new ButtonProvider(){
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getImageDescriptor()
 */
    @Override public ImageDescriptor getImageDescriptor(){
      return VdbUiPlugin.singleton.getImageDescriptor(Images.REMOVE_ROLE);
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getText()
 */
    @Override public String getText(){
      return null;
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#getToolTip()
 */
    @Override public String getToolTip(){
      return i18n("String_Node_Str");
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#isEnabled(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public boolean isEnabled(    IStructuredSelection selection){
      return !selection.isEmpty();
    }
    /** 
 * {@inheritDoc}
 * @see org.teiid.designer.ui.common.widget.ButtonProvider#selected(org.eclipse.jface.viewers.IStructuredSelection)
 */
    @Override public void selected(    IStructuredSelection selection){
      if (ConfirmationDialog.confirm(CONFIRM_REMOVE_MESSAGE)) {
        for (        final Object element : selection.toList()) {
          if (element instanceof DataRole) {
            vdbEditor.getVdb().removeDataRole(((DataRole)element).getName());
          }
        }
      }
    }
  }
;
  dataRolesGroup.add(removeProvider);
  dataRolesGroup.setInput(vdbEditor.getVdb());
  this.cloneDataRoleAction=new Action(i18n("String_Node_Str")){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.action.Action#run()
 */
    @Override public void run(){
      if (selectedDataRole != null) {
        DataRole newDR=new DataRole(selectedDataRole.getName() + i18n("String_Node_Str"),selectedDataRole.getDescription(),selectedDataRole.isAnyAuthenticated(),selectedDataRole.isAllowCreateTempTables(),selectedDataRole.isGrantAll(),selectedDataRole.getRoleNames(),selectedDataRole.getPermissions());
        vdbEditor.getVdb().addDataRole(newDR);
        dataRolesGroup.getTable().getViewer().refresh();
      }
    }
  }
;
  this.cloneDataRoleAction.setEnabled(true);
  final TableViewer dataRolesViewer=dataRolesGroup.getTable().getViewer();
  final MenuManager dataRolesMenuManager=new MenuManager();
  dataRolesViewer.getControl().setMenu(dataRolesMenuManager.createContextMenu(parent));
  dataRolesViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
 */
    @Override public void selectionChanged(    final SelectionChangedEvent event){
      dataRolesMenuManager.removeAll();
      IStructuredSelection sel=(IStructuredSelection)dataRolesViewer.getSelection();
      if (sel.size() == 1) {
        selectedDataRole=(DataRole)sel.getFirstElement();
        dataRolesMenuManager.add(cloneDataRoleAction);
      }
    }
  }
);
}