📄 policynestingform.java
字号:
/*
* SSL-Explorer
*
* Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.sslexplorer.policyframework.wizards.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMapping;
import com.sslexplorer.boot.PropertyList;
import com.sslexplorer.input.MultiSelectDataSource;
import com.sslexplorer.input.MultiSelectSelectionModel;
import com.sslexplorer.policyframework.PolicyNestingDataSource;
import com.sslexplorer.wizard.AbstractWizardSequence;
import com.sslexplorer.wizard.forms.DefaultWizardForm;
public class PolicyNestingForm extends DefaultWizardForm {
private PropertyList nestedPolicies;
private MultiSelectSelectionModel policyModel;
// Statics for sequence attributes
public final static String ATTR_NESTED_POLICIES = "nestedPolicies";
public PolicyNestingForm() {
super(true, true, "/WEB-INF/jsp/content/policyframework/policyWizard/policyNesting.jspf",
"", true, false, "policyNesting", "policyframework", "policyWizard.policyNesting", 3);
}
/**
* @return Returns the nestedPolicies.
*/
public String getNestedPolicies() {
return nestedPolicies.getAsTextFieldText();
}
/**
* @param nestedPolicies The nestedPolicies to set.
*/
public void setNestedPolicies(String nestedPolicies) {
this.nestedPolicies.setAsTextFieldText(nestedPolicies);
}
/* (non-Javadoc)
* @see com.sslexplorer.wizard.forms.DefaultWizardForm#apply(com.sslexplorer.wizard.AbstractWizardSequence)
*/
public void apply(AbstractWizardSequence sequence) throws Exception {
super.apply(sequence);
sequence.putAttribute(ATTR_NESTED_POLICIES, nestedPolicies);
}
/* (non-Javadoc)
* @see com.sslexplorer.wizard.forms.DefaultWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence, javax.servlet.http.HttpServletRequest)
*/
public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
super.init(sequence, request);
nestedPolicies = (PropertyList)sequence.getAttribute(ATTR_NESTED_POLICIES, new PropertyList());
}
/**
* @return Returns the policyModel.
*/
public MultiSelectSelectionModel getPolicyModel() {
return policyModel;
}
/**
* @param policyModel The policyModel to set.
*/
public void setPolicyModel(MultiSelectSelectionModel policyModel) {
this.policyModel = policyModel;
}
/* (non-Javadoc)
* @see com.sslexplorer.wizard.forms.AbstractWizardForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping, request);
AbstractWizardSequence seq = getWizardSequence(request);
nestedPolicies = (PropertyList)seq.getAttribute(ATTR_NESTED_POLICIES, new PropertyList());
MultiSelectDataSource policies = new PolicyNestingDataSource(null);
policyModel = new MultiSelectSelectionModel(policies, nestedPolicies);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -