usr/src/java/vpanels/panels/apache/org/opensolaris/os/vp/panels/apache/client/swing/ModulesControl.java
author Stephen Talley <stephen.talley@sun.com>
Tue, 22 Sep 2009 16:46:54 -0400
changeset 360 8943c58ad2f5
parent 349 cb1b71664c9a
child 404 32e9b6a2b5f2
permissions -rw-r--r--
11508 Control, DefaultControl refactoring
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     1
/*
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     2
 * CDDL HEADER START
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     3
 *
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     7
 *
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    11
 * and limitations under the License.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    12
 *
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    18
 *
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    19
 * CDDL HEADER END
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    20
 */
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    21
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    22
/*
193
f14789edacaf 6066 Simplify help URL creation
David Powell <David.Powell@sun.com>
parents: 171
diff changeset
    23
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    24
 * Use is subject to license terms.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    25
 */
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    26
219
57841c113efe 6788 package names should share o.o.o.vp prefix
Stephen Talley <stephen.talley@sun.com>
parents: 214
diff changeset
    27
package org.opensolaris.os.vp.panels.apache.client.swing;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    28
276
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
    29
import java.awt.Image;
196
4aefd5567f1e 4364 sysid: resolve SysIdUtil.createNPException
Stephen Talley <stephen.talley@sun.com>
parents: 193
diff changeset
    30
import java.net.URL;
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    31
import java.util.List;
318
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
    32
import javax.swing.*;
40
d1412af1ae5b 3215 ActionAbortedException is used too broadly
Stephen Talley <stephen.talley@sun.com>
parents: 39
diff changeset
    33
import org.opensolaris.os.vp.panel.common.control.*;
d1412af1ae5b 3215 ActionAbortedException is used too broadly
Stephen Talley <stephen.talley@sun.com>
parents: 39
diff changeset
    34
import org.opensolaris.os.vp.panel.swing.control.*;
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    35
import org.opensolaris.os.vp.panel.swing.view.*;
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    36
import org.opensolaris.os.vp.util.misc.*;
318
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
    37
import org.opensolaris.os.vp.util.swing.*;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    38
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    39
public class ModulesControl extends ListSelectorControl<ApachePanelDescriptor,
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    40
    ListSelectorPanel, Module> implements HasImages {
223
aa68c366f3d0 6923 Menu, connection pull-down should be removed from main window
Stephen Talley <stephen.talley@sun.com>
parents: 219
diff changeset
    41
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    42
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    43
    // Static data
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    44
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    45
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    46
    public static final String ID = "modules";
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    47
    public static final String NAME = Finder.getString("modules.title");
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    48
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    49
    protected static final List<Image> images = IconUtil.getImages(
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    50
	Module.icons);
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    51
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    52
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    53
    // Instance data
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    54
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    55
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    56
    private HasModules parent;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    57
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    58
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    59
    // Constructors
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    60
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    61
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    62
    public ModulesControl(ApachePanelDescriptor descriptor,
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    63
	HasModules parent) {
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    64
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    65
	super(ID, NAME, descriptor);
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    66
	this.parent = parent;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    67
    }
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    68
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    69
    //
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    70
    // HasImages methods
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    71
    //
223
aa68c366f3d0 6923 Menu, connection pull-down should be removed from main window
Stephen Talley <stephen.talley@sun.com>
parents: 219
diff changeset
    72
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    73
    @Override
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    74
    public List<? extends Image> getImages() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    75
	return images;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    76
    }
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    77
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    78
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    79
    // Control methods
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    80
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    81
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    82
    @Override
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    83
    public Navigable[] getForwardingPath() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    84
	List<Module> modules = parent.getModules().getChildren();
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    85
	if (!modules.isEmpty()) {
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    86
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    87
	    Module module = modules.get(0);
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    88
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    89
	    return new Navigable[] {
274
4ff6ceb185e6 8085 SimpleNavigable construction could be simplified
Stephen Talley <stephen.talley@sun.com>
parents: 264
diff changeset
    90
		new SimpleNavigable(ModuleControl.ID, null,
4ff6ceb185e6 8085 SimpleNavigable construction could be simplified
Stephen Talley <stephen.talley@sun.com>
parents: 264
diff changeset
    91
		    ModuleControl.PARAM_MODULE, module.getId())
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    92
	    };
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    93
	}
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    94
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
    95
	return null;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    96
    }
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    97
360
8943c58ad2f5 11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents: 349
diff changeset
    98
    @Override
8943c58ad2f5 11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents: 349
diff changeset
    99
    public URL getHelpURL() {
8943c58ad2f5 11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents: 349
diff changeset
   100
	return buildHelpURL("help/apache.html", "#apache-modules");
8943c58ad2f5 11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents: 349
diff changeset
   101
    }
8943c58ad2f5 11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents: 349
diff changeset
   102
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   103
    //
171
ec6f1c5d031c 2537 API and UI should support deep-linking into help text
Stephen Talley <stephen.talley@sun.com>
parents: 136
diff changeset
   104
    // DefaultControl methods
ec6f1c5d031c 2537 API and UI should support deep-linking into help text
Stephen Talley <stephen.talley@sun.com>
parents: 136
diff changeset
   105
    //
ec6f1c5d031c 2537 API and UI should support deep-linking into help text
Stephen Talley <stephen.talley@sun.com>
parents: 136
diff changeset
   106
ec6f1c5d031c 2537 API and UI should support deep-linking into help text
Stephen Talley <stephen.talley@sun.com>
parents: 136
diff changeset
   107
    @Override
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   108
    protected void ensureChildrenCreated() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   109
	if (children.size() == 0) {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   110
	    ApachePanelDescriptor descriptor = getPanelDescriptor();
276
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
   111
	    SwingControl child = new ModuleControl(descriptor, this);
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
   112
	    addChildren(child);
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
   113
	    addToLayout(child);
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   114
	}
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   115
    }
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   116
171
ec6f1c5d031c 2537 API and UI should support deep-linking into help text
Stephen Talley <stephen.talley@sun.com>
parents: 136
diff changeset
   117
    //
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   118
    // SwingControl methods
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   119
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   120
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   121
    @Override
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   122
    protected ListSelectorPanel createComponent() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   123
	ListSelectorPanel panel = new ListSelectorPanel();
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   124
	panel.setSelectionTitle(Finder.getString("modules.list.title"));
318
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
   125
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   126
	JList list = panel.getSelectionComponent();
318
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
   127
	SimpleCellRenderer renderer = new ManagedObjectCellRenderer<Module>();
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
   128
	renderer.configureFor(list);
6fd18ef74a39 9609 apache: virtual host list should show status
Stephen Talley <stephen.talley@sun.com>
parents: 306
diff changeset
   129
	list.setCellRenderer(renderer);
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   130
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   131
	addAction(panel, new CreateModuleAction(this), true, true);
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   132
	addAction(panel, new DeleteModuleAction(this), true, true);
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   133
301
98464369f109 9311 MutableProperties should support PropertyChangeEvents
Stephen Talley <stephen.talley@sun.com>
parents: 276
diff changeset
   134
	addDefaultCloseAction(panel, false);
244
b6f1fb4f5a89 7624 SwingControl: createComponent implementations should not be required to call setComponent
Stephen Talley <stephen.talley@sun.com>
parents: 238
diff changeset
   135
	addDefaultHelpAction(panel);
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   136
276
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
   137
	setDefaultContentView(new NoModulePanel());
d8275f1fd45b 8091 apache: empty mime types/modules list should show help text
Stephen Talley <stephen.talley@sun.com>
parents: 274
diff changeset
   138
244
b6f1fb4f5a89 7624 SwingControl: createComponent implementations should not be required to call setComponent
Stephen Talley <stephen.talley@sun.com>
parents: 238
diff changeset
   139
	return panel;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   140
    }
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   141
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   142
    //
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   143
    // ListSelectorControl methods
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   144
    //
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   145
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   146
    @Override
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   147
    protected int getListIndexOf(Control child) {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   148
	Module module = ((ModuleControl)child).getModule();
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   149
	int index = parent.getModules().indexOf(module);
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   150
	assert module == getComponent().getSelectionComponent().getModel().
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   151
	    getElementAt(index);
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   152
	return index;
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   153
    }
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   154
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   155
    @Override
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   156
    protected ListModel getListModel() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   157
	return new ManagedObjectTableModel<Module>(parent.getModules(),
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   158
	    null);
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   159
    }
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   160
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   161
    @Override
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   162
    protected Navigable[] getPathForSelection(List<Module> selection) {
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   163
	if (selection.size() != 1) {
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   164
	    return null;
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   165
	}
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   166
349
cb1b71664c9a 11070 SelectorControl should provide a default implementation of Control.getBrowsable
Stephen Talley <stephen.talley@sun.com>
parents: 340
diff changeset
   167
	Module selected = selection.get(0);
cb1b71664c9a 11070 SelectorControl should provide a default implementation of Control.getBrowsable
Stephen Talley <stephen.talley@sun.com>
parents: 340
diff changeset
   168
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   169
	return new Navigable[] {
349
cb1b71664c9a 11070 SelectorControl should provide a default implementation of Control.getBrowsable
Stephen Talley <stephen.talley@sun.com>
parents: 340
diff changeset
   170
	    new SimpleNavigable(ModuleControl.ID, selected.getName(),
cb1b71664c9a 11070 SelectorControl should provide a default implementation of Control.getBrowsable
Stephen Talley <stephen.talley@sun.com>
parents: 340
diff changeset
   171
		ModuleControl.PARAM_MODULE, selected.getId())
340
8bdbfc87f145 10594 sharemgr: new selection-based UI design
Stephen Talley <stephen.talley@sun.com>
parents: 318
diff changeset
   172
	};
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   173
    }
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   174
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   175
    //
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   176
    // ModulesControl methods
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   177
    //
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   178
264
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   179
    public HasModules getHasModules() {
d5cd4b2e7426 8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents: 259
diff changeset
   180
	return parent;
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   181
    }
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
   182
}