1 package org.enhydra.shark.swingclient.worklisthandler; 2 3 import java.awt.*; 4 5 import javax.swing.*; 6 7 8 9 import org.enhydra.shark.api.client.wfmodel.*; 10 import org.enhydra.shark.swingclient.*; 11 import org.enhydra.shark.swingclient.worklist.*; 12 13 19 public class SharksWorklistHandler extends SharkClient { 20 21 private Worklist worklist; 22 23 24 26 public SharksWorklistHandler (JFrame frame) { 27 super(frame); 28 } 29 31 protected Component createCenterComponent () { 32 worklist = new Worklist(this,false); 33 return worklist; 34 } 35 36 public synchronized void refresh (boolean mandatoryRefreshing) { 37 if (worklist.getResource()==null) { 38 try { 39 WfResource res=workflowService.getResourceObject(); 40 worklist.setResource(res); 41 } catch (Exception ex) {} 42 } else { 43 worklist.refresh(); 44 } 45 } 46 47 protected String getAppTitleResourceString() { 48 return "WorklistHandlerTitle"; 49 } 50 51 protected String getLogoResourceString() { 52 return "worklisthandlerLogo"; 53 } 54 55 protected String getIconResourceString() { 56 return "worklisthandlerIcon"; 57 } 58 59 protected String getMenubarResourceString() { 60 return "worklisthandlermainmenubar"; 61 } 62 63 protected String getRefreshingRateString () { 64 return "RefreshingRateInSecondsForWorklistHandler"; 65 } 66 67 public void clearComponents() { 68 try { 69 setTitle(); 70 while (isRefresherActive()); 74 worklist.clear(); 75 } catch (Exception ex) {ex.printStackTrace();} 76 } 77 78 public Worklist getWorklist () { 79 return worklist; 80 } 81 82 83 public static void main(String [] args) { 84 String vers = System.getProperty("java.version"); 86 if (vers.compareTo("1.4") < 0) { 87 System.out.println("!!!WARNING: Shark Worklist Handler must be run with a " + 88 "1.4 or higher version VM!!!"); 89 System.exit(1); 90 } 91 92 new SharksWorklistHandler(new JFrame()); 93 } 94 95 } 96 97 | Popular Tags |