public void startLifeCycle() {
    initAllExtension();
    initModelAllExtension(model);
    initXMLAllExtension(model.getSession(), model.getOptionsParam());
    initViewAllExtension(view);

    hookAllExtension();
    startAllExtension();
  }
Exemple #2
0
 protected void saveTabState(AbstractPanel ap) {
   if (ap == null) {
     return;
   }
   Model.getSingleton()
       .getOptionsParam()
       .getConfig()
       .setProperty(OptionsParamView.TAB_PIN_OPTION + "." + safeName(ap.getName()), ap.isPinned());
   try {
     Model.getSingleton().getOptionsParam().getConfig().save();
   } catch (ConfigurationException e) {
     logger.error(e.getMessage(), e);
   }
 }
 @Override
 public void performActions(List<HistoryReference> hrefs) throws Exception {
   super.performActions(hrefs);
   View.getSingleton()
       .showSessionDialog(
           Model.getSingleton().getSession(), SessionExcludeFromSpiderPanel.PANEL_NAME);
 }
 @Override
 public void performAction(SiteNode sn) {
   try {
     Session session = Model.getSingleton().getSession();
     session.getExcludeFromSpiderRegexs().add(new StructuralSiteNode(sn).getRegexPattern());
   } catch (DatabaseException e) {
     // Ignore
   }
 }
 /** This method initializes this */
 private void initialize() {
   this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
   this.setContentPane(getJPanel());
   if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
     this.setSize(282, 118);
   }
   this.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
   this.setResizable(false);
 }
Exemple #6
0
 private boolean isTabPinned(Component c) {
   boolean showByDefault = false;
   if (c instanceof AbstractPanel) {
     showByDefault = ((AbstractPanel) c).isShowByDefault();
   }
   return Model.getSingleton()
       .getOptionsParam()
       .getConfig()
       .getBoolean(OptionsParamView.TAB_PIN_OPTION + "." + safeName(c.getName()), showByDefault);
 }
 @Override
 public void performAction(SiteNode sn) throws Exception {
   Session session = Model.getSingleton().getSession();
   String url = new URI(sn.getHierarchicNodeName(), false).toString();
   if (sn.isLeaf()) {
     url = Pattern.quote(url);
   } else {
     url = Pattern.quote(url + "/") + ".*";
   }
   session.getExcludeFromSpiderRegexs().add(url);
 }
 private void hookOptions(ExtensionHook hook) {
   Vector<AbstractParam> list = hook.getOptionsParamSetList();
   for (int i = 0; i < list.size(); i++) {
     try {
       AbstractParam paramSet = list.get(i);
       model.getOptionsParam().addParamSet(paramSet);
     } catch (Exception e) {
       // ZAP: Log the exception
       logger.error(e.getMessage(), e);
     }
   }
 }
Exemple #9
0
 @Override
 public HttpPanelRequest getRequestPanel() {
   if (requestPanel == null) {
     // ZAP: constructor changed
     requestPanel = new HttpPanelRequest(false, OptionsParamView.BASE_VIEW_KEY + ".main.");
     // ZAP: Added 'right arrow' icon
     requestPanel.setIcon(new ImageIcon(View.class.getResource("/resource/icon/16/105.png")));
     requestPanel.setName(Constant.messages.getString("http.panel.request.title")); // ZAP: i18n
     requestPanel.loadConfig(Model.getSingleton().getOptionsParam().getConfig());
   }
   return requestPanel;
 }
Exemple #10
0
  /** This method initializes this */
  private void initialize(ImageIcon icon) {
    this.setLayout(new CardLayout());
    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
      this.setSize(474, 251);
    }
    this.setName(Constant.messages.getString(prefix + ".panel.title"));
    this.setIcon(icon);
    this.add(getPanelCommand(), prefix + ".panel");
    scanStatus = new ScanStatus(icon, Constant.messages.getString(prefix + ".panel.title"));

    if (View.isInitialised()) {
      View.getSingleton()
          .getMainFrame()
          .getMainFooterPanel()
          .addFooterToolbarRightLabel(scanStatus.getCountLabel());
    }
  }
Exemple #11
0
  /** This method initializes this */
  private void initialize() {
    this.setTitle(Constant.messages.getString("history.managetags.title"));
    this.setContentPane(getJPanel());
    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
      this.setSize(panelWidth, panelHeight);
    }
    this.addWindowListener(
        new java.awt.event.WindowAdapter() {
          @Override
          public void windowOpened(java.awt.event.WindowEvent e) {}

          @Override
          public void windowClosing(java.awt.event.WindowEvent e) {}
        });

    pack();
  }
  protected void performAction(String name, String url) {
    Session session = Model.getSingleton().getSession();

    if (context == null) {
      context = session.getNewContext(name);
    }

    // Manually create the UI shared contexts so any modifications are done
    // on an UI shared Context, so changes can be undone by pressing Cancel
    SessionDialog sessionDialog = View.getSingleton().getSessionDialog();
    sessionDialog.recreateUISharedContexts(session);
    Context uiSharedContext = sessionDialog.getUISharedContext(context.getIndex());

    uiSharedContext.addIncludeInContextRegex(url);

    // Show the session dialog without recreating UI Shared contexts
    View.getSingleton()
        .showSessionDialog(session, ContextIncludePanel.getPanelName(context.getIndex()), false);
  }
  private void deleteHistory(HistoryReference ref) {

    if (ref == null) {
      return;
    }
    extension.removeFromHistoryList(ref);

    SiteNode node = ref.getSiteNode();
    if (node == null) {
      return;
    }

    Session session = Model.getSingleton().getSession();
    SiteMap map = session.getSiteTree();

    if (node.getHistoryReference() == ref) {
      // same active Node
      PopupDeleteMenu.delete(map, node);
    } else {
      node.getPastHistoryReference().remove(ref);
    }
  }
Exemple #14
0
 private static synchronized void getScannerOptionsSync() {
   if (scannerOptions == null) {
     scannerOptions = Model.getSingleton().getOptionsParam().getParamSet(ScannerParam.class);
   }
 }
 /** This method initializes this */
 private void initialize() {
   if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
     this.setSize(500, 375);
   }
 }
Exemple #16
0
 private static boolean isScaleImages() {
   if (scaleImages == null) {
     scaleImages = Model.getSingleton().getOptionsParam().getViewParam().isScaleImages();
   }
   return scaleImages;
 }
 @Override
 protected void initComponents() {
   addComponent(
       new RequestSplitComponent<HttpMessage>(),
       Model.getSingleton().getOptionsParam().getConfig());
 }