1
23package org.jzuul.gdk.swt;
24
25import org.eclipse.swt.SWT;
26import org.eclipse.swt.events.SelectionEvent;
27import org.eclipse.swt.events.SelectionListener;
28import org.eclipse.swt.layout.FillLayout;
29import org.eclipse.swt.layout.GridLayout;
30import org.eclipse.swt.widgets.Button;
31import org.eclipse.swt.widgets.Composite;
32import org.eclipse.swt.widgets.Group;
33import org.eclipse.swt.widgets.Shell;
34import org.jdom.Element;
35
36
37
44public class PlayerEditorComposite extends Composite {
45 Element player;
46
47
51 public PlayerEditorComposite(Composite arg0, int arg1) {
52 super(arg0, arg1);
53 this.setLayout(new FillLayout());
54
55 Group mainGroup = new Group(this, SWT.NONE);
56 mainGroup.setText(Messages.getString("PLAYER_OPTIONS")); mainGroup.setLayout(new GridLayout(1,true));
58
59 Button contentButton = new Button(mainGroup,SWT.PUSH);
60 contentButton.setText(Messages.getString("EDIT_CONTENTS"));
62 contentButton.addSelectionListener(new SelectionListener() {
63
64 public void widgetSelected(SelectionEvent arg0) {
65 ContentsEditorDialog ed = new ContentsEditorDialog(new Shell(arg0.display), SWT.NONE);
66 ed.open(player);
67 }
68
69 public void widgetDefaultSelected(SelectionEvent arg0) {}
70 });
71
72 Button targetButton = new Button(mainGroup, SWT.PUSH);
73 targetButton.setText(Messages.getString("EDIT_TARGETS"));
75 targetButton.addSelectionListener(new SelectionListener() {
76
77 public void widgetSelected(SelectionEvent arg0) {
78 TargetEditor ed = new TargetEditor(new Shell(arg0.display), SWT.NONE);
79 ed.open(player);
80 }
81
82 public void widgetDefaultSelected(SelectionEvent arg0) {}
83 });
84
85
86 }
87
88 public void showPlayer(Element player) {
89 this.player = player;
90 }
91
92 public void clear() {
93 this.player = null;
94 }
95
96 public void updateData() {
97 }
99
00
01}
02