diff -r 077ebe3d0d24 -r f1d133b09a8c components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOpenPortsPanel.java --- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOpenPortsPanel.java Tue Dec 16 05:53:51 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. - */ - -package com.oracle.solaris.vp.panels.firewall.client.swing; - -import java.util.List; -import javax.swing.*; -import com.oracle.solaris.vp.panel.swing.view.ChangeIndicator; -import com.oracle.solaris.vp.util.misc.ChangeableAggregator; -import com.oracle.solaris.vp.util.misc.finder.Finder; -import com.oracle.solaris.vp.util.misc.property.BasicMutableProperty; -import com.oracle.solaris.vp.util.swing.*; -import com.oracle.solaris.vp.util.swing.layout.*; - -@SuppressWarnings({"serial"}) -public class FirewallOpenPortsPanel extends SettingsPanel { - - // - // Static data - // - - private static final String TAB_TITLE = - Finder.getString("openports.table.title"); - - // - // Instance data - // - - private BasicMutableProperty> pListProperty = - new BasicMutableProperty>(); - private OpenPortsTablePanel epanel; - - // - // Constructors - // - - public FirewallOpenPortsPanel() { - epanel = new OpenPortsTablePanel(); - - pListProperty = new BasicMutableProperty>(); - new TablePanelPropertySynchronizer(pListProperty, epanel); - - getHelpField().setText(Finder.getString( - "description.policy.openports")); - - JPanel form = createForm(); - setContent(form, false, true); - } - - // - // CommonEditPanel methods - // - - protected JPanel createForm() { - ChangeableAggregator aggregator = getChangeableAggregator(); - - JLabel tabLabel = new JLabel(TAB_TITLE); - - ChangeIndicator pListChange = new ChangeIndicator(); - pListProperty.addChangeListener(pListChange); - aggregator.addChangeables(pListProperty); - - JPanel formPanel = new JPanel(); - formPanel.setOpaque(false); - Form form = new Form(formPanel, VerticalAnchor.FILL); - - int hGap = GUIUtil.getHalfGap(); - int sGap = 3 * hGap; - - ColumnLayoutConstraint c = new ColumnLayoutConstraint( - HorizontalAnchor.FILL, hGap); - - RowLayoutConstraint r = new RowLayoutConstraint( - VerticalAnchor.TOP, hGap); - r.setLayoutIfInvisible(true); - - form.addRow(HorizontalAnchor.LEFT, c.clone().setGap(sGap)); - form.add(tabLabel, r); - form.add(pListChange, r); - - form.addRow(HorizontalAnchor.LEFT, c); - form.add(epanel, r); - - return formPanel; - } - - public void setOpenPortListProperty(BasicMutableProperty> - pListProperty) { - this.pListProperty = pListProperty; - } - - public BasicMutableProperty> getOpenPortsListProperty() { - return pListProperty; - } - - public void init(AccessPolicy p) { - pListProperty.update( - ((SimpleAccessPolicy) p).getSavedOpenPortList(), false); - } -}