Package net.azib.ipscan.core

Examples of net.azib.ipscan.core.UserErrorException


          Labels.getLabel("text.favorite.add"));
      String favoriteName = inputDialog.open(feederInfo);
     
      if (favoriteName != null) {
        if (favoritesConfig.get(favoriteName) != null) {
          throw new UserErrorException("favorite.alreadyExists");
        }
        favoritesConfig.add(favoriteName, feederRegistry.current());
        event.display.getActiveShell().setText(favoriteName + " - " + Version.NAME);
      }
    }
View Full Code Here


        workingTerminal = XTERM;
        launchInTerminal(execString, workingDir);
      }
      else {
        // even XTERM doesn't work...
        throw new UserErrorException("openTerminal.failed", execString);
      }
    }
  }
View Full Code Here

            Runtime.getRuntime().exec(splitCommand(openerString), null, opener.workingDir);
          }
        }
      }
      catch (Exception e) {
        throw new UserErrorException("opener.failed", openerString);
      }
    }
  }
View Full Code Here

      String fetcherId = matcher.group(1);

      // retrieve the scanned value
      Object scannedValue = getScannedValue(selectedItem, fetcherId);
      if (scannedValue == null || scannedValue instanceof Empty) {
        throw new UserErrorException("opener.nullFetcherValue", fetcherId);         
      }
     
      matcher.appendReplacement(sb, scannedValue.toString());
    }
    matcher.appendTail(sb);
View Full Code Here

  }

  private Object getScannedValue(int selectedItem, String fetcherId) {
    int fetcherIndex = fetcherRegistry.getSelectedFetcherIndex(fetcherId);
    if (fetcherIndex < 0) {
      throw new UserErrorException("opener.unknownFetcher", fetcherId);
    }

    Object value = scanningResults.getResult(selectedItem).getValues().get(fetcherIndex);
   
    if ((value == null || value instanceof Empty) && fetcherId.equals(HostnameFetcher.ID)) {
View Full Code Here

            stateMachine.transitionToNext(); // we need to continue previous scan
        }

      }
      catch (Exception e) {
        throw new UserErrorException("fileLoad.failed", e);
      }
    }
View Full Code Here

      this.isSelection = isSelection;
    }

    public void handleEvent(Event event) {
      if (resultTable.getItemCount() <= 0) {
        throw new UserErrorException("commands.noResults");
      }

      if (!stateMachine.inState(ScanningState.IDLE)) {
        // ask the user whether to save incomplete results
        MessageBox box = new MessageBox(resultTable.getShell(), SWT.YES | SWT.NO | SWT.ICON_WARNING | SWT.SHEET);
View Full Code Here

      }

      super.open();
    }
    else {
      throw new UserErrorException("commands.noResults");
    }
  }
View Full Code Here

  public static void openURL(String url) {
    try {
      Desktop.getDesktop().browse(new URI(url));
    }
    catch (Exception e) {
      throw new UserErrorException("openURL.failed", url);
    }
  }
View Full Code Here

  /**
   * Checks that there is at least one item selected in the results list.
   */
  static void checkSelection(ResultTable resultTable) {
    if (resultTable.getItemCount() <= 0) {
      throw new UserErrorException("commands.noResults");
    }
    else
    if (resultTable.getSelectionIndex() < 0) {
      throw new UserErrorException("commands.noSelection");
    }
  }
View Full Code Here

TOP

Related Classes of net.azib.ipscan.core.UserErrorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.