diff options
author | Claudia Knobloch | 2011-05-19 15:46:23 +0000 |
---|---|---|
committer | Claudia Knobloch | 2011-05-19 15:46:23 +0000 |
commit | 826d6029d7197d9ee25713df25e57f8d799f906d (patch) | |
tree | 4e5fcf05fe09de37b143a7c9de193287ba9e0fc0 | |
parent | da8c2958a6e6f9831cde5ba70621039d55b5715b (diff) | |
download | org.eclipse.ptp-826d6029d7197d9ee25713df25e57f8d799f906d.tar.gz org.eclipse.ptp-826d6029d7197d9ee25713df25e57f8d799f906d.tar.xz org.eclipse.ptp-826d6029d7197d9ee25713df25e57f8d799f906d.zip |
register(name, output, input)
3 files changed, 21 insertions, 30 deletions
diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java index 7171b4b37..a3a2f5c3a 100644 --- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java +++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java @@ -118,41 +118,23 @@ public class LMLManager { /************************************************************************************************************** * Communication methods **************************************************************************************************************/ - - public void register(String name, InputStream stream) { - // TODO implement - } public void register(String name, InputStream input, OutputStream output) { -// if(!LGUIS.containsKey(name)) { -// ILguiItem lgui = new LguiItem(); -// synchronized (LGUIS) { -// LGUIS.put(name, lgui); -// } -// } -// fLguiItem = LGUIS.get(name); -// this.input = input; -// this.output = output; - // TODO find a solution + if (!LGUIS.containsKey(name)) { + synchronized (LGUIS) { + LGUIS.put(name, new LguiItem()); + } + } + ILguiItem lguiItem = LGUIS.get(name); + lguiItem.getCurrentLayout(output); + lguiItem.update(input); + fireNewLgui(); } public void getCurrentLayout() { fLguiItem.getCurrentLayout(output); } - public void open(String name) { - // TODO load all data - if (LGUIS.containsKey(name)) { - fLguiItem = LGUIS.get(name); - fireSelectedLgui(); - } - } - - public void close(String name) { - // TODO save data - fLguiItem = null; - } - /************************************************************************************************************** * Lgui handling methods **************************************************************************************************************/ diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java index 5c3ec42c4..ec00bfa76 100644 --- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java +++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java @@ -89,4 +89,6 @@ public interface ILguiItem { public void removeJob(IJobStatus jobStatus); public void getCurrentLayout(OutputStream output); + + public boolean isEmpty(); } diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java index a56a669cc..e99ad45c8 100644 --- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java +++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java @@ -347,7 +347,6 @@ public class LguiItem implements ILguiItem { } catch (URISyntaxException e) { e.printStackTrace(); } - try { lgui = parseLML(xmlFile); } catch (MalformedURLException e) { @@ -361,7 +360,6 @@ public class LguiItem implements ILguiItem { } public void update() { - ILguiUpdatedEvent e = new LguiUpdatedEvent(this); for (ILguiListener listener : listeners) { listener.handleEvent(e); @@ -370,7 +368,11 @@ public class LguiItem implements ILguiItem { public void update(InputStream stream) { lgui = parseLML(stream); - update(); + update(); + } + + public boolean isEmpty() { + return lgui.getObjectsAndRelationsAndInformation().isEmpty(); } /************************************************************************************************************** @@ -379,6 +381,11 @@ public class LguiItem implements ILguiItem { public void getCurrentLayout(OutputStream output) { LguiType layoutLgui = getLayoutFromModell(); Marshaller marshaller = LMLCorePlugin.getDefault().getMarshaller(); + try { + marshaller.marshal(layoutLgui, output); + } catch (JAXBException e) { + e.printStackTrace(); + } } /** |