Ejemplo n.º 1
0
 /**
  * Displays an error for the case of an invalid node name
  *
  * @param node the node
  */
 private void displayErrorForInvalidName(INodePO node) {
   String fqNodeName = Utils.getFullyQualifiedName(node);
   ErrorMessagePresenter.getPresenter()
       .showErrorMessage(
           new JBException(
               NLS.bind(Messages.InvalidNodeName, new String[] {fqNodeName}),
               MessageIDs.E_INVALID_NODE_NAME),
           new String[] {fqNodeName},
           null);
   progressMonitor.setCanceled(true);
 }
Ejemplo n.º 2
0
 /**
  * Returns the default toolkit for a project by inspecting its first AUT
  *
  * @param project the project
  * @return the name of the default toolkit
  */
 private String determineDefaultToolkit(IProjectPO project) {
   String toolkit = null;
   IAUTMainPO firstAUT = null;
   try {
     firstAUT = project.getAutCont().getAutMainList().iterator().next();
   } catch (NoSuchElementException e) {
     ErrorMessagePresenter.getPresenter()
         .showErrorMessage(
             new JBException(Messages.NoAutInProject, MessageIDs.E_NO_AUT_IN_PROJECT),
             null,
             null);
     progressMonitor.setCanceled(true);
   }
   if (firstAUT != null) {
     toolkit = firstAUT.getToolkit();
   }
   if (toolkit.equals(CommandConstants.RCP_TOOLKIT)) {
     toolkit = CommandConstants.SWT_TOOLKIT;
   }
   return toolkit;
 }