Changeset 12423
- Timestamp:
- 2006-08-09T14:34:06+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/FormatPane.java
r12366 r12423 48 48 import org.greenstone.gatherer.cdm.Format; 49 49 import org.greenstone.gatherer.cdm.Control; 50 import org.greenstone.gatherer.Configuration; 51 import org.greenstone.gatherer.shell.GShell; 52 import org.greenstone.gatherer.shell.GShellEvent; 53 import org.greenstone.gatherer.shell.GShellListener; 50 54 51 55 public class FormatPane 52 56 extends BaseConfigPane 53 implements PreviewButtonOwner 57 implements PreviewButtonOwner,GShellListener{ 54 58 55 59 56 60 /** The button for viewing the collection. */ 57 61 private PreviewButton preview_button = null; 62 private boolean buildCanceled = false; 58 63 59 64 /** The constructor. */ … … 73 78 preview_button.setVariablePreview(true); 74 79 preview_button.setOwner(this); 80 81 82 75 83 preview_button.addActionListener(new ActionListener() { 76 84 public void actionPerformed(ActionEvent event) { 77 if (view != null) { 78 view.loseFocus(); 85 if (view != null) { 86 view.loseFocus(); 87 } 88 89 if (buildCanceled){ 90 WarningDialog dialog = new WarningDialog("warning.ShowPreviousCollection", "ShowPreviousCollection.Title", Dictionary.get("ShowPreviousCollection.Message"), null, false); 91 dialog.display(); 92 dialog.dispose(); 79 93 } 80 94 } … … 85 99 add(side_panel, BorderLayout.WEST); 86 100 } 101 102 public void gainFocus(){ 103 104 if (Gatherer.c_man.built() && Configuration.library_url != null) { 105 preview_button.setEnabled(true); 106 } 107 else{ 108 preview_button.setEnabled(false); 109 } 110 111 } 112 113 114 /** All implementation of GShellListener must include this method so the listener can be informed of messages from the GShell. 115 * @param event A <strong>GShellEvent</strong> that contains, amoung other things, the message. 116 */ 117 public synchronized void message(GShellEvent event) { 118 // We don't care. 119 } 120 121 122 /** All implementation of GShellListener must include this method so the listener can be informed when a GShell begins its task. Implementation side-effect, not actually used. 123 * @param event A <strong>GShellEvent</strong> that contains details of the initial state of the <strong>GShell</strong> before task comencement. 124 */ 125 public synchronized void processBegun(GShellEvent event) { 126 buildCanceled = false; 127 } 128 129 /** All implementation of GShellListener must include this method so the listener can be informed when a GShell completes its task. 130 * @param event A <strong>GShellEvent</strong> that contains details of the final state of the <strong>GShell</strong> after task completion. 131 */ 132 public synchronized void processComplete(GShellEvent event) { 133 if(event.getStatus() == GShell.OK) { 134 if(event.getType() == GShell.BUILD) { 135 buildCanceled = false; 136 } 137 } 138 else { 139 buildCanceled = true; 140 } 141 } 142 143 87 144 88 145 protected Control getSubControls(String type) {
Note:
See TracChangeset
for help on using the changeset viewer.