]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 package org
.tianocore
.frameworkwizard
.platform
.ui
;
16 import java
.awt
.Component
;
17 import java
.awt
.event
.ActionEvent
;
18 import java
.awt
.event
.ActionListener
;
19 import java
.util
.Vector
;
21 import javax
.swing
.AbstractCellEditor
;
22 import javax
.swing
.JButton
;
23 import javax
.swing
.JFrame
;
24 import javax
.swing
.JTable
;
25 import javax
.swing
.table
.TableCellEditor
;
29 Editor for table cell with GUID value.
30 @since PackageEditor 1.0
32 public class ListEditor
extends AbstractCellEditor
implements TableCellEditor
, ActionListener
{
37 private static final long serialVersionUID
= 1L;
42 protected static final String EDIT
= "edit";
46 button
= new JButton();
47 button
.setActionCommand(EDIT
);
48 button
.addActionListener(this);
49 button
.setBorderPainted(false);
52 dialog
= new GenListDialog(this);
56 public ListEditor(Vector
<String
> v
) {
62 * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)
64 public Component
getTableCellEditorComponent(JTable arg0
, Object arg1
, boolean arg2
, int arg3
, int arg4
) {
65 // TODO Auto-generated method stub
71 * @see javax.swing.CellEditor#getCellEditorValue()
73 public Object
getCellEditorValue() {
74 // TODO Auto-generated method stub
79 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
81 public void actionPerformed(ActionEvent arg0
) {
82 // TODO Auto-generated method stub
83 if (EDIT
.equals(arg0
.getActionCommand())) {
84 //The user has clicked the cell, so
85 //bring up the dialog.
86 button
.setText(archs
);
87 dialog
.setList(archs
);
88 dialog
.setVisible(true);
90 //Make the renderer reappear.
93 else { //User pressed dialog's "OK" button.
94 Vector
<String
> v
= dialog
.getList();
96 for (int i
= 0; i
< v
.size(); ++i
) {