From 29bbf451a22916d39017ec1a3f53f4e0f0e65ee0 Mon Sep 17 00:00:00 2001 From: abranson Date: Mon, 1 Aug 2011 13:57:20 +0200 Subject: Java7 compatibility and some code refresh --- source/com/c2kernel/gui/tabs/ExecutionPane.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) mode change 100755 => 100644 source/com/c2kernel/gui/tabs/ExecutionPane.java (limited to 'source/com/c2kernel/gui/tabs/ExecutionPane.java') diff --git a/source/com/c2kernel/gui/tabs/ExecutionPane.java b/source/com/c2kernel/gui/tabs/ExecutionPane.java old mode 100755 new mode 100644 index de07319..0685fa9 --- a/source/com/c2kernel/gui/tabs/ExecutionPane.java +++ b/source/com/c2kernel/gui/tabs/ExecutionPane.java @@ -24,16 +24,16 @@ import com.c2kernel.utils.Logger; public class ExecutionPane extends EntityTabPane implements EntityProxyObserver { - ArrayList jobList = null; + ArrayList jobList = null; Object jobLock = new Object(); - String[] emptyAct = { "--" }; + ActivityItem emptyAct = new ActivityItem(); JLabel noActs = new JLabel(Language.translate("There are currently no activities that you can execute in this item.")); JPanel view = new JPanel(new GridLayout(1, 1)); ActivityViewer currentActView; - JComboBox activitySelector = new JComboBox(emptyAct); + JComboBox activitySelector = new JComboBox(); Box activityBox = Box.createHorizontalBox(); String selAct = null; - ArrayList activities; + ArrayList activities; String autoRun = null; boolean init = false; boolean formIsActive = false; @@ -76,24 +76,23 @@ public class ExecutionPane extends EntityTabPane implements EntityProxyObserver synchronized (jobLock) { activitySelector.removeAllItems(); view.removeAll(); - activities = new ArrayList(); + activities = new ArrayList(); try { jobList = ((ItemProxy)sourceEntity.getEntity()).getJobList(MainFrame.userAgent); - activitySelector.addItem("--"); + activitySelector.addItem(emptyAct); for (Iterator e = jobList.iterator(); e.hasNext();) { Job thisJob = (Job)e.next(); Logger.msg(7, "ExecutionPane - loadJobList " + thisJob.isOutcomeUsed() + "|" + thisJob.getSchemaType() + "|" + thisJob.getSchemaVersion() + "|"); ActivityItem newAct = new ActivityItem(thisJob); if (activities.contains(newAct)) { int actIndex = activities.indexOf(newAct); - ((ActivityItem)activities.get(actIndex)).addJob(thisJob); + activities.get(actIndex).addJob(thisJob); } else { Logger.msg(2, "ExecutionPane - Adding activity " + thisJob.getStepPath()); addActivity(newAct); } } } catch (Exception e) { - activitySelector.addItem("Error fetching JobList"); Logger.debug("Error fetching joblist"); Logger.error(e); } @@ -103,7 +102,7 @@ public class ExecutionPane extends EntityTabPane implements EntityProxyObserver view.add(noActs); break; case 1 : - currentActView = new ActivityViewer((ActivityItem)activities.get(0), (ItemProxy)sourceEntity.getEntity(), this); + currentActView = new ActivityViewer(activities.get(0), (ItemProxy)sourceEntity.getEntity(), this); c.fill = GridBagConstraints.BOTH; gridbag.setConstraints(view, c); view.add(currentActView); @@ -135,7 +134,7 @@ public class ExecutionPane extends EntityTabPane implements EntityProxyObserver } } private void selectActivity(Object selObj) { - if (!(selObj instanceof ActivityItem)) + if (selObj.equals(emptyAct)) return; view.removeAll(); c.fill = GridBagConstraints.BOTH; -- cgit v1.2.3