public Throwable getTestConnectionException(IConnection conn) {
   return conn != null
       ? conn.getConnectException()
       : new RuntimeException(
           ConnectivityUIPlugin.getDefault()
               .getResourceString("actions.ping.failure")); // $NON-NLS-1$
 }
 /**
  * @param exceptions
  * @param name
  */
 public XmlURLPingJob(Shell shell, IConnectionProfile profile) {
   super(ConnectivityUIPlugin.getDefault().getResourceString("actions.ping.job")); // $NON-NLS-1$
   setSystem(false);
   setUser(true);
   this.shell = shell;
   icp = profile;
 }
 /** @param name */
 public XmlUrlPingUIJob(Shell shell, Throwable exception) {
   super(
       ConnectivityUIPlugin.getDefault()
           .getResourceString("actions.ping.uijob")); // $NON-NLS-1$
   setSystem(false);
   this.exception = exception;
   this.shell = shell;
 }
 public void showTestConnectionMessage(Shell shell, Throwable exception) {
   if (exception == null) {
     MessageDialog.openInformation(
         shell,
         ConnectivityUIPlugin.getDefault()
             .getResourceString("dialog.title.success"), // $NON-NLS-1$
         ConnectivityUIPlugin.getDefault()
             .getResourceString("actions.ping.success")); // $NON-NLS-1$
     // setValidatedConnection(true);
     validate();
   } else {
     ExceptionHandler.showException(
         shell,
         ConnectivityUIPlugin.getDefault()
             .getResourceString("dialog.title.error"), // $NON-NLS-1$
         ConnectivityUIPlugin.getDefault()
             .getResourceString("actions.ping.failure"), // $NON-NLS-1$
         exception);
     // setValidatedConnection(false);
     setErrorMessage(exception.getMessage());
     validate();
   }
 }
    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
     */
    @Override
    protected IStatus run(IProgressMonitor monitor) {
      monitor.beginTask(
          ConnectivityUIPlugin.getDefault().getResourceString("actions.ping.title"), // $NON-NLS-1$
          IProgressMonitor.UNKNOWN);

      Exception exception = testXmlUrlConnection(icp);

      monitor.done();

      new XmlUrlPingUIJob(shell, exception).schedule();

      return Status.OK_STATUS;
    }
 private IConnectionProfileRepository getTargetRepository() throws CoreException {
   Object destination = mArguments.getDestination();
   if (destination instanceof ProfileManager) {
     return null;
   } else if (destination instanceof IConnectionProfile) {
     IManagedConnection imc =
         ((IConnectionProfile) destination)
             .getManagedConnection(IConnectionProfileRepository.class.getName());
     if (imc == null) {
       // invalid profile
       Status status =
           new Status(
               Status.ERROR,
               ConnectivityUIPlugin.getDefault().getBundle().getSymbolicName(),
               -1,
               ConnectivityUIPlugin.getDefault()
                   .getResourceString("CPCopyChange.error.InvalidTarget"),
               null); //$NON-NLS-1$
       throw new CoreException(status);
     } else if (!imc.isConnected()
         || imc.getConnection() == null
         || imc.getConnection().getRawConnection() == null) {
       // repository must be connected
       Status status =
           new Status(
               Status.ERROR,
               ConnectivityUIPlugin.getDefault().getBundle().getSymbolicName(),
               -1,
               ConnectivityUIPlugin.getDefault()
                   .getResourceString(
                       "CPCopyChange.error.RepositoryNotConnected", //$NON-NLS-1$
                       new Object[] {((IConnectionProfile) destination).getName()}),
               null);
       throw new CoreException(status);
     }
     return (IConnectionProfileRepository) imc.getConnection().getRawConnection();
   }
   // unsupported type
   Status status =
       new Status(
           Status.ERROR,
           ConnectivityUIPlugin.getDefault().getBundle().getSymbolicName(),
           -1,
           ConnectivityUIPlugin.getDefault().getResourceString("CPCopyChange.error.InvalidTarget"),
           null); //$NON-NLS-1$
   throw new CoreException(status);
 }
 /* (non-Javadoc)
  * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
  */
 public String getProcessorName() {
   return MessageFormat.format(
       ConnectivityUIPlugin.getDefault().getResourceString("CPRenameChange.name"), // $NON-NLS-1$
       new Object[] {mProfile.getName()});
   //		return ConnectivityUIPlugin.getDefault().getResourceString("CPRenameProcessor.name");
 }
 public String getProcessorName() {
   return ConnectivityUIPlugin.getDefault()
       .getResourceString("CPMoveProcessor.name"); // $NON-NLS-1$
 }