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);
  }
Beispiel #2
0
 public void renameContext(Context c) {
   for (AbstractParamPanel panel : contextPanels) {
     if (panel instanceof ContextGeneralPanel) {
       ContextGeneralPanel ctxPanel = (ContextGeneralPanel) panel;
       if (ctxPanel.getContextIndex() == c.getIndex()) {
         getSessionDialog().renamePanel(ctxPanel, c.getName());
         break;
       }
     }
   }
 }
Beispiel #3
0
  public void addContext(Context c) {
    ContextGeneralPanel contextGenPanel = new ContextGeneralPanel(c.getName(), c.getIndex());
    getSessionDialog()
        .addParamPanel(
            new String[] {Constant.messages.getString("context.list")}, contextGenPanel, false);
    this.contextPanels.add(contextGenPanel);

    ContextIncludePanel contextIncPanel = new ContextIncludePanel(c);
    getSessionDialog()
        .addParamPanel(
            new String[] {Constant.messages.getString("context.list"), contextGenPanel.getName()},
            contextIncPanel,
            false);
    this.contextPanels.add(contextIncPanel);

    ContextExcludePanel contextExcPanel = new ContextExcludePanel(c);
    getSessionDialog()
        .addParamPanel(
            new String[] {Constant.messages.getString("context.list"), contextGenPanel.getName()},
            contextExcPanel,
            false);
    this.contextPanels.add(contextExcPanel);

    ContextTechnologyPanel contextTechPanel = new ContextTechnologyPanel(c);
    getSessionDialog()
        .addParamPanel(
            new String[] {Constant.messages.getString("context.list"), contextGenPanel.getName()},
            contextTechPanel,
            false);
    this.contextPanels.add(contextTechPanel);

    for (ContextPanelFactory cpf : this.contextPanelFactories) {
      AbstractParamPanel panel = cpf.getContextPanel(c);
      getSessionDialog()
          .addParamPanel(
              new String[] {Constant.messages.getString("context.list"), contextGenPanel.getName()},
              panel,
              false);
      this.contextPanels.add(panel);
    }
  }
 /**
  * Instantiates a new context session management panel.
  *
  * @param extension the extension
  * @param context the context
  */
 public ContextSessionManagementPanel(ExtensionSessionManagement extension, Context context) {
   super(context.getIndex());
   this.extension = extension;
   initialize();
 }