diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..412eeda
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b9d6bd9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,215 @@
+#################
+## Eclipse
+#################
+
+*.pydevproject
+.project
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
+
+
+#################
+## Visual Studio
+#################
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+
+[Dd]ebug/
+[Rr]elease/
+x64/
+build/
+[Bb]in/
+[Oo]bj/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.log
+*.scc
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.Publish.xml
+*.pubxml
+
+# NuGet Packages Directory
+## TODO: If you have NuGet Package Restore enabled, uncomment the next line
+#packages/
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+sql/
+*.Cache
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.[Pp]ublish.xml
+*.pfx
+*.publishsettings
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+App_Data/*.mdf
+App_Data/*.ldf
+
+#############
+## Windows detritus
+#############
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Mac crap
+.DS_Store
+
+
+#############
+## Python
+#############
+
+*.py[co]
+
+# Packages
+*.egg
+*.egg-info
+dist/
+build/
+eggs/
+parts/
+var/
+sdist/
+develop-eggs/
+.installed.cfg
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+
+#Translations
+*.mo
+
+#Mr Developer
+.mr.developer.cfg
diff --git a/osgi.bundle.monitoring.dem1/.classpath b/osgi.bundle.monitoring.dem1/.classpath
index b1dabee..098194c 100644
--- a/osgi.bundle.monitoring.dem1/.classpath
+++ b/osgi.bundle.monitoring.dem1/.classpath
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/osgi.bundle.monitoring.dem1/.project b/osgi.bundle.monitoring.dem1/.project
index 69aeb69..1a15684 100644
--- a/osgi.bundle.monitoring.dem1/.project
+++ b/osgi.bundle.monitoring.dem1/.project
@@ -1,28 +1,28 @@
-
-
- osgi.bundle.monitoring.dem1
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
+
+
+ osgi.bundle.monitoring.dem1
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/osgi.bundle.monitoring.dem1/.settings/org.eclipse.jdt.core.prefs b/osgi.bundle.monitoring.dem1/.settings/org.eclipse.jdt.core.prefs
index 11f6e46..f42de36 100644
--- a/osgi.bundle.monitoring.dem1/.settings/org.eclipse.jdt.core.prefs
+++ b/osgi.bundle.monitoring.dem1/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/osgi.bundle.monitoring.dem1/.settings/org.eclipse.pde.core.prefs b/osgi.bundle.monitoring.dem1/.settings/org.eclipse.pde.core.prefs
index d711c29..e8ff8be 100644
--- a/osgi.bundle.monitoring.dem1/.settings/org.eclipse.pde.core.prefs
+++ b/osgi.bundle.monitoring.dem1/.settings/org.eclipse.pde.core.prefs
@@ -1,4 +1,4 @@
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
-resolve.requirebundle=false
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/Activator.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/Activator.java
index 66a2cd9..a1b3328 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/Activator.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/Activator.java
@@ -1,53 +1,53 @@
-package osgi.bundle.monitoring.dem1;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-import osgi.bundle.monitoring.dem1.controller.ButtonListener;
-import osgi.bundle.monitoring.dem1.controller.CheckBoxMenuListener;
-import osgi.bundle.monitoring.dem1.controller.MenuItemListener;
-import osgi.bundle.monitoring.dem1.model.Model;
-import osgi.bundle.monitoring.dem1.view.View;
-
-public class Activator implements BundleActivator
-{
-
- private static BundleContext context;
-
- private View view;
-
- private Model model;
-
- static BundleContext getContext()
- {
- return context;
- }
-
- public void start(BundleContext bundleContext) throws Exception
- {
- Activator.context = bundleContext;
-
- view = new View();
- view.initUi();
-
- model = new Model(bundleContext);
-
- ButtonListener buttonListener = new ButtonListener(model, view);
- CheckBoxMenuListener checkBoxMenuListener = new CheckBoxMenuListener(model);
- MenuItemListener menuItemListener = new MenuItemListener(model, view);
-
- model.addObserver(view);
-
- view.completeUi(buttonListener, checkBoxMenuListener, menuItemListener);
- }
-
- public void stop(BundleContext bundleContext) throws Exception
- {
- Activator.context = null;
-
- model.unregisterServices();
-
- view.close();
- }
-
-}
+package osgi.bundle.monitoring.dem1;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import osgi.bundle.monitoring.dem1.controller.ButtonListener;
+import osgi.bundle.monitoring.dem1.controller.CheckBoxMenuListener;
+import osgi.bundle.monitoring.dem1.controller.MenuItemListener;
+import osgi.bundle.monitoring.dem1.model.Model;
+import osgi.bundle.monitoring.dem1.view.View;
+
+public class Activator implements BundleActivator
+{
+
+ private static BundleContext context;
+
+ private View view;
+
+ private Model model;
+
+ static BundleContext getContext()
+ {
+ return context;
+ }
+
+ public void start(BundleContext bundleContext) throws Exception
+ {
+ Activator.context = bundleContext;
+
+ view = new View();
+ view.initUi();
+
+ model = new Model(bundleContext);
+
+ ButtonListener buttonListener = new ButtonListener(model, view);
+ CheckBoxMenuListener checkBoxMenuListener = new CheckBoxMenuListener(model);
+ MenuItemListener menuItemListener = new MenuItemListener(model, view);
+
+ model.addObserver(view);
+
+ view.completeUi(buttonListener, checkBoxMenuListener, menuItemListener);
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception
+ {
+ Activator.context = null;
+
+ model.unregisterServices();
+
+ view.close();
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/ButtonListener.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/ButtonListener.java
index 78353f2..641e403 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/ButtonListener.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/ButtonListener.java
@@ -1,120 +1,120 @@
-package osgi.bundle.monitoring.dem1.controller;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JButton;
-
-import osgi.bundle.monitoring.dem1.model.Model;
-import osgi.bundle.monitoring.dem1.view.View;
-
-public class ButtonListener implements MouseListener
-{
-
- private Model model;
-
- private View view;
-
- public ButtonListener(Model model, View view)
- {
- this.model = model;
- this.view = view;
- }
-
- @Override
- public void mouseClicked(MouseEvent me)
- {
- String button = ((JButton)me.getSource()).getText();
-
- if(button.compareTo("Install") == 0)
- {
- String fileName = view.installDialog();
-
- if(fileName != null)
- {
- model.installBundle(fileName);
- }
- }
- else if(button.compareTo("Uninstall") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.uninstallBundle(id);
- }
- }
- else if(button.compareTo("Update") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.updateBundle(id);
- }
- }
- else if(button.compareTo("Start") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.startBundle(id);
- }
- }
- else if(button.compareTo("Stop") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.stopBundle(id);
- }
- }
- else if(button.compareTo("Monitor") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.setIdOpened(id);
- view.checkMonitoring(id);
- }
- }
- else if(button.compareTo("Unmonitor") == 0)
- {
- long id = view.getSelectedBundleId();
-
- if(id >= 0)
- {
- model.setIdClosed(id);
- view.uncheckMonitoring(id);
- }
- }
- }
-
- @Override
- public void mouseEntered(MouseEvent me)
- {
-
- }
-
- @Override
- public void mouseExited(MouseEvent me)
- {
-
- }
-
- @Override
- public void mousePressed(MouseEvent me)
- {
-
- }
-
- @Override
- public void mouseReleased(MouseEvent me)
- {
-
- }
-
-}
+package osgi.bundle.monitoring.dem1.controller;
+
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JButton;
+
+import osgi.bundle.monitoring.dem1.model.Model;
+import osgi.bundle.monitoring.dem1.view.View;
+
+public class ButtonListener implements MouseListener
+{
+
+ private Model model;
+
+ private View view;
+
+ public ButtonListener(Model model, View view)
+ {
+ this.model = model;
+ this.view = view;
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent me)
+ {
+ String button = ((JButton)me.getSource()).getText();
+
+ if(button.compareTo("Install") == 0)
+ {
+ String fileName = view.installDialog();
+
+ if(fileName != null)
+ {
+ model.installBundle(fileName);
+ }
+ }
+ else if(button.compareTo("Uninstall") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.uninstallBundle(id);
+ }
+ }
+ else if(button.compareTo("Update") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.updateBundle(id);
+ }
+ }
+ else if(button.compareTo("Start") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.startBundle(id);
+ }
+ }
+ else if(button.compareTo("Stop") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.stopBundle(id);
+ }
+ }
+ else if(button.compareTo("Monitor") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.setIdOpened(id);
+ view.checkMonitoring(id);
+ }
+ }
+ else if(button.compareTo("Unmonitor") == 0)
+ {
+ long id = view.getSelectedBundleId();
+
+ if(id >= 0)
+ {
+ model.setIdClosed(id);
+ view.uncheckMonitoring(id);
+ }
+ }
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent me)
+ {
+
+ }
+
+ @Override
+ public void mouseExited(MouseEvent me)
+ {
+
+ }
+
+ @Override
+ public void mousePressed(MouseEvent me)
+ {
+
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent me)
+ {
+
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/CheckBoxMenuListener.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/CheckBoxMenuListener.java
index 0b4c500..ee33148 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/CheckBoxMenuListener.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/CheckBoxMenuListener.java
@@ -1,139 +1,139 @@
-package osgi.bundle.monitoring.dem1.controller;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import javax.swing.JCheckBoxMenuItem;
-
-import org.osgi.framework.BundleEvent;
-
-import osgi.bundle.monitoring.dem1.model.Model;
-import osgi.framework.monitoring.event.RepositoryEvent;
-import osgi.framework.monitoring.event.ManifestEvent;
-
-public class CheckBoxMenuListener implements ActionListener
-{
-
- private Model model;
-
- public CheckBoxMenuListener(Model model)
- {
- this.model = model;
- }
-
- public void changeMonitorState(boolean state, int index)
- {
- if(state == true)
- {
- model.setMonitorOn(index);
- }
- else
- {
- model.setMonitorOff(index);
- }
- }
-
- private void changeTypeFilter(boolean state, int index, int type)
- {
- if(state == true)
- {
- model.setTypeOpened(index, type);
- }
- else
- {
- model.setTypeClosed(index, type);
- }
- }
-
- @Override
- public void actionPerformed(ActionEvent ae)
- {
- JCheckBoxMenuItem cb = (JCheckBoxMenuItem)ae.getSource();
- String checkBox = cb.getText();
-
- if(checkBox.compareTo("Bundle repository") == 0)
- {
- changeMonitorState(cb.getState(), 0);
- }
- else if(checkBox.compareTo("Bundle state") == 0)
- {
- changeMonitorState(cb.getState(), 1);
- }
- else if(checkBox.compareTo("Bundle manifest") == 0)
- {
- changeMonitorState(cb.getState(), 2);
- }
- else if(checkBox.compareTo("Data field") == 0)
- {
- changeMonitorState(cb.getState(), 3);
- }
- else if(checkBox.compareTo("Create") == 0)
- {
- changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_CREATE);
- }
- else if(checkBox.compareTo("Modify") == 0)
- {
- changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_MODIFY);
- }
- else if(checkBox.compareTo("Delete") == 0)
- {
- changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_DELETE);
- }
- else if(checkBox.compareTo("Installed") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.INSTALLED);
- }
- else if(checkBox.compareTo("Lazy Activation") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.LAZY_ACTIVATION);
- }
- else if(checkBox.compareTo("Resolved") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.RESOLVED);
- }
- else if(checkBox.compareTo("Started") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.STARTED);
- }
- else if(checkBox.compareTo("Starting") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.STARTING);
- }
- else if(checkBox.compareTo("Stopped") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.STOPPED);
- }
- else if(checkBox.compareTo("Stopping") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.STOPPING);
- }
- else if(checkBox.compareTo("Uninstalled") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.UNINSTALLED);
- }
- else if(checkBox.compareTo("Unresolved") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.UNRESOLVED);
- }
- else if(checkBox.compareTo("Updated") == 0)
- {
- changeTypeFilter(cb.getState(), 1, BundleEvent.UPDATED);
- }
- else if(checkBox.compareTo("Created") == 0)
- {
- changeTypeFilter(cb.getState(), 2, ManifestEvent.CREATED);
- }
- else if(checkBox.compareTo("Modified") == 0)
- {
- changeTypeFilter(cb.getState(), 2, ManifestEvent.MODIFIED);
- }
- else if(checkBox.compareTo("Deleted") == 0)
- {
- changeTypeFilter(cb.getState(), 2, ManifestEvent.DELETED);
- }
- else
- {
- //fields
- }
- }
-
-}
+package osgi.bundle.monitoring.dem1.controller;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.JCheckBoxMenuItem;
+
+import org.osgi.framework.BundleEvent;
+
+import osgi.bundle.monitoring.dem1.model.Model;
+import osgi.framework.monitoring.event.RepositoryEvent;
+import osgi.framework.monitoring.event.ManifestEvent;
+
+public class CheckBoxMenuListener implements ActionListener
+{
+
+ private Model model;
+
+ public CheckBoxMenuListener(Model model)
+ {
+ this.model = model;
+ }
+
+ public void changeMonitorState(boolean state, int index)
+ {
+ if(state == true)
+ {
+ model.setMonitorOn(index);
+ }
+ else
+ {
+ model.setMonitorOff(index);
+ }
+ }
+
+ private void changeTypeFilter(boolean state, int index, int type)
+ {
+ if(state == true)
+ {
+ model.setTypeOpened(index, type);
+ }
+ else
+ {
+ model.setTypeClosed(index, type);
+ }
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent ae)
+ {
+ JCheckBoxMenuItem cb = (JCheckBoxMenuItem)ae.getSource();
+ String checkBox = cb.getText();
+
+ if(checkBox.compareTo("Bundle repository") == 0)
+ {
+ changeMonitorState(cb.getState(), 0);
+ }
+ else if(checkBox.compareTo("Bundle state") == 0)
+ {
+ changeMonitorState(cb.getState(), 1);
+ }
+ else if(checkBox.compareTo("Bundle manifest") == 0)
+ {
+ changeMonitorState(cb.getState(), 2);
+ }
+ else if(checkBox.compareTo("Data field") == 0)
+ {
+ changeMonitorState(cb.getState(), 3);
+ }
+ else if(checkBox.compareTo("Create") == 0)
+ {
+ changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_CREATE);
+ }
+ else if(checkBox.compareTo("Modify") == 0)
+ {
+ changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_MODIFY);
+ }
+ else if(checkBox.compareTo("Delete") == 0)
+ {
+ changeTypeFilter(cb.getState(), 0, RepositoryEvent.ENTRY_DELETE);
+ }
+ else if(checkBox.compareTo("Installed") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.INSTALLED);
+ }
+ else if(checkBox.compareTo("Lazy Activation") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.LAZY_ACTIVATION);
+ }
+ else if(checkBox.compareTo("Resolved") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.RESOLVED);
+ }
+ else if(checkBox.compareTo("Started") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.STARTED);
+ }
+ else if(checkBox.compareTo("Starting") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.STARTING);
+ }
+ else if(checkBox.compareTo("Stopped") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.STOPPED);
+ }
+ else if(checkBox.compareTo("Stopping") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.STOPPING);
+ }
+ else if(checkBox.compareTo("Uninstalled") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.UNINSTALLED);
+ }
+ else if(checkBox.compareTo("Unresolved") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.UNRESOLVED);
+ }
+ else if(checkBox.compareTo("Updated") == 0)
+ {
+ changeTypeFilter(cb.getState(), 1, BundleEvent.UPDATED);
+ }
+ else if(checkBox.compareTo("Created") == 0)
+ {
+ changeTypeFilter(cb.getState(), 2, ManifestEvent.CREATED);
+ }
+ else if(checkBox.compareTo("Modified") == 0)
+ {
+ changeTypeFilter(cb.getState(), 2, ManifestEvent.MODIFIED);
+ }
+ else if(checkBox.compareTo("Deleted") == 0)
+ {
+ changeTypeFilter(cb.getState(), 2, ManifestEvent.DELETED);
+ }
+ else
+ {
+ //fields
+ }
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/MenuItemListener.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/MenuItemListener.java
index 710755a..0124829 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/MenuItemListener.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/controller/MenuItemListener.java
@@ -1,36 +1,36 @@
-package osgi.bundle.monitoring.dem1.controller;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JMenuItem;
-
-import osgi.bundle.monitoring.dem1.model.Model;
-import osgi.bundle.monitoring.dem1.view.View;
-
-public class MenuItemListener implements ActionListener
-{
-
- private Model model;
-
- private View view;
-
- public MenuItemListener(Model model, View view)
- {
- this.model = model;
- this.view = view;
- }
-
- @Override
- public void actionPerformed(ActionEvent ae)
- {
- JMenuItem mi = (JMenuItem)ae.getSource();
- String menuItem = mi.getText();
-
- if(menuItem.compareTo("Add field") == 0)
- {
- model.addField(view.addFieldDialog());
- }
- }
-
-}
+package osgi.bundle.monitoring.dem1.controller;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JMenuItem;
+
+import osgi.bundle.monitoring.dem1.model.Model;
+import osgi.bundle.monitoring.dem1.view.View;
+
+public class MenuItemListener implements ActionListener
+{
+
+ private Model model;
+
+ private View view;
+
+ public MenuItemListener(Model model, View view)
+ {
+ this.model = model;
+ this.view = view;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent ae)
+ {
+ JMenuItem mi = (JMenuItem)ae.getSource();
+ String menuItem = mi.getText();
+
+ if(menuItem.compareTo("Add field") == 0)
+ {
+ model.addField(view.addFieldDialog());
+ }
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/ContextManager.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/ContextManager.java
index 94a8699..3f99fed 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/ContextManager.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/ContextManager.java
@@ -1,75 +1,75 @@
-package osgi.bundle.monitoring.dem1.model;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-/**
- * Provides methods to manage bundles in the OSGi BundleContext
- * @author Anibal
- */
-public class ContextManager
-{
-
- private BundleContext bundleContext;
-
- public ContextManager(BundleContext bundleContext)
- {
- this.bundleContext = bundleContext;
- }
-
- public void installBundle(String file)
- {
- try
- {
- bundleContext.installBundle("file:"+file);
- } catch (BundleException e)
- {
-
- }
- }
-
- public void uninstallBundle(long id)
- {
- try
- {
- bundleContext.getBundle(id).uninstall();
- } catch (BundleException e)
- {
-
- }
- }
-
- public void updateBundle(long id)
- {
- try
- {
- bundleContext.getBundle(id).update();
- } catch (BundleException e)
- {
-
- }
- }
-
- public void startBundle(long id)
- {
- try
- {
- bundleContext.getBundle(id).start();
- } catch (BundleException e)
- {
-
- }
- }
-
- public void stopBundle(long id)
- {
- try
- {
- bundleContext.getBundle(id).stop();
- } catch (BundleException e)
- {
-
- }
- }
-
-}
+package osgi.bundle.monitoring.dem1.model;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * Provides methods to manage bundles in the OSGi BundleContext
+ * @author Anibal
+ */
+public class ContextManager
+{
+
+ private BundleContext bundleContext;
+
+ public ContextManager(BundleContext bundleContext)
+ {
+ this.bundleContext = bundleContext;
+ }
+
+ public void installBundle(String file)
+ {
+ try
+ {
+ bundleContext.installBundle("file:"+file);
+ } catch (BundleException e)
+ {
+
+ }
+ }
+
+ public void uninstallBundle(long id)
+ {
+ try
+ {
+ bundleContext.getBundle(id).uninstall();
+ } catch (BundleException e)
+ {
+
+ }
+ }
+
+ public void updateBundle(long id)
+ {
+ try
+ {
+ bundleContext.getBundle(id).update();
+ } catch (BundleException e)
+ {
+
+ }
+ }
+
+ public void startBundle(long id)
+ {
+ try
+ {
+ bundleContext.getBundle(id).start();
+ } catch (BundleException e)
+ {
+
+ }
+ }
+
+ public void stopBundle(long id)
+ {
+ try
+ {
+ bundleContext.getBundle(id).stop();
+ } catch (BundleException e)
+ {
+
+ }
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/FieldEvent.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/FieldEvent.java
index 0b1e6bf..a59ad52 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/FieldEvent.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/FieldEvent.java
@@ -1,26 +1,26 @@
-package osgi.bundle.monitoring.dem1.model;
-
-public class FieldEvent
-{
-
- private String className;
-
- private String fieldName;
-
- public FieldEvent(String className, String fieldName)
- {
- this.className = className;
- this.fieldName = fieldName;
- }
-
- public String getClassName()
- {
- return className;
- }
-
- public String getFieldName()
- {
- return fieldName;
- }
-
-}
+package osgi.bundle.monitoring.dem1.model;
+
+public class FieldEvent
+{
+
+ private String className;
+
+ private String fieldName;
+
+ public FieldEvent(String className, String fieldName)
+ {
+ this.className = className;
+ this.fieldName = fieldName;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public String getFieldName()
+ {
+ return fieldName;
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Model.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Model.java
index 51a8d27..87118f7 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Model.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Model.java
@@ -1,95 +1,95 @@
-package osgi.bundle.monitoring.dem1.model;
-
-import org.osgi.framework.BundleContext;
-
-import osgi.bundle.monitoring.dem1.view.View;
-
-/**
- * Provides an API with the actions the user can perform
- * @author Anibal
- */
-public class Model
-{
-
- private Monitor monitor;
-
- private ContextManager contextManager;
-
- public Model(BundleContext bundleContext)
- {
- monitor = new Monitor(bundleContext);
-
- contextManager = new ContextManager(bundleContext);
- }
-
- public void installBundle(String fileName)
- {
- contextManager.installBundle(fileName);
- }
-
- public void uninstallBundle(long id)
- {
- contextManager.uninstallBundle(id);
- }
-
- public void updateBundle(long id)
- {
- contextManager.updateBundle(id);
- }
-
- public void startBundle(long id)
- {
- contextManager.startBundle(id);
- }
-
- public void stopBundle(long id)
- {
- contextManager.stopBundle(id);
- }
-
- public void setIdOpened(long id)
- {
- monitor.setIdOpened(id);
- }
-
- public void setIdClosed(long id)
- {
- monitor.setIdClosed(id);
- }
-
- public void setMonitorOn(int index)
- {
- monitor.setMonitorOn(index);
- }
-
- public void setMonitorOff(int index)
- {
- monitor.setMonitorOff(index);
- }
-
- public void setTypeOpened(int index, int type)
- {
- monitor.setTypeOpened(index, type);
- }
-
- public void setTypeClosed(int index, int type)
- {
- monitor.setTypeClosed(index, type);
- }
-
- public void addObserver(View view)
- {
- monitor.addObserver(view);
- }
-
- public void addField(String s)
- {
- monitor.addField(s);
- }
-
- public void unregisterServices()
- {
- monitor.uniregisterServices();
- }
-
-}
+package osgi.bundle.monitoring.dem1.model;
+
+import org.osgi.framework.BundleContext;
+
+import osgi.bundle.monitoring.dem1.view.View;
+
+/**
+ * Provides an API with the actions the user can perform
+ * @author Anibal
+ */
+public class Model
+{
+
+ private Monitor monitor;
+
+ private ContextManager contextManager;
+
+ public Model(BundleContext bundleContext)
+ {
+ monitor = new Monitor(bundleContext);
+
+ contextManager = new ContextManager(bundleContext);
+ }
+
+ public void installBundle(String fileName)
+ {
+ contextManager.installBundle(fileName);
+ }
+
+ public void uninstallBundle(long id)
+ {
+ contextManager.uninstallBundle(id);
+ }
+
+ public void updateBundle(long id)
+ {
+ contextManager.updateBundle(id);
+ }
+
+ public void startBundle(long id)
+ {
+ contextManager.startBundle(id);
+ }
+
+ public void stopBundle(long id)
+ {
+ contextManager.stopBundle(id);
+ }
+
+ public void setIdOpened(long id)
+ {
+ monitor.setIdOpened(id);
+ }
+
+ public void setIdClosed(long id)
+ {
+ monitor.setIdClosed(id);
+ }
+
+ public void setMonitorOn(int index)
+ {
+ monitor.setMonitorOn(index);
+ }
+
+ public void setMonitorOff(int index)
+ {
+ monitor.setMonitorOff(index);
+ }
+
+ public void setTypeOpened(int index, int type)
+ {
+ monitor.setTypeOpened(index, type);
+ }
+
+ public void setTypeClosed(int index, int type)
+ {
+ monitor.setTypeClosed(index, type);
+ }
+
+ public void addObserver(View view)
+ {
+ monitor.addObserver(view);
+ }
+
+ public void addField(String s)
+ {
+ monitor.addField(s);
+ }
+
+ public void unregisterServices()
+ {
+ monitor.uniregisterServices();
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Monitor.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Monitor.java
index 1c6df32..937b38a 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Monitor.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/model/Monitor.java
@@ -1,177 +1,177 @@
-package osgi.bundle.monitoring.dem1.model;
-
-import java.util.ArrayList;
-import java.util.Observable;
-import java.util.Observer;
-
-import org.osgi.framework.BundleContext;
-
-import osgi.framework.monitoring.event.DataFieldMonitor;
-import osgi.framework.monitoring.event.ManifestMonitor;
-import osgi.framework.monitoring.event.RepositoryMonitor;
-import osgi.framework.monitoring.event.StateMonitor;
-import osgi.framework.monitoring.event.EventMonitor;
-import osgi.framework.monitoring.event.filter.IdFilterSet;
-import osgi.framework.monitoring.event.filter.TypeFilterSet;
-
-/**
- * Manages the different types of monitors: repository monitor, state monitor,
- * manifest monitor and data field monitor
- * @author Anibal
- */
-public class Monitor extends Observable implements Observer
-{
- // Contains all monitor objects
- private ArrayList bundleMonitors;
-
- // Contains all type filer for the various monitors
- private ArrayList typeFilters;
-
- private IdFilterSet idFilter;
-
- /**
- * Constructor. Initialize the different monitors
- * @param bundleContext
- */
- public Monitor(BundleContext bundleContext)
- {
- bundleMonitors = new ArrayList();
-
- typeFilters = new ArrayList();
-
- idFilter = new IdFilterSet();
-
- // Positions in array 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
- bundleMonitors.add(new RepositoryMonitor(bundleContext));
- bundleMonitors.add(new StateMonitor(bundleContext));
- bundleMonitors.add(new ManifestMonitor(bundleContext));
- bundleMonitors.add(new DataFieldMonitor(bundleContext));
-
- // Set the type filter sets to each monitor object
- for(int i = 0; i < bundleMonitors.size() - 1; i++)
- {
- typeFilters.add(new TypeFilterSet());
- bundleMonitors.get(i).setTypeFilterSet(typeFilters.get(i));
- bundleMonitors.get(i).setBundleFilterSet(idFilter);
- }
-
- // Registers necessary services for DataFieldMonitor
- ((DataFieldMonitor)bundleMonitors.get(3)).registerWeavingService();
-
- // StateMonitor activated by default
- setMonitorOn(1);
- }
-
- /**
- * Activate monitor object
- * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
- */
- public void setMonitorOn(int index)
- {
- bundleMonitors.get(index).addObserver(this);
- }
-
- /**
- * Deactivate monitor object
- * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
- */
- public void setMonitorOff(int index)
- {
- bundleMonitors.get(index).deleteObservers();
- }
-
- /**
- * Open or close type in one TypeFilterSet
- * @param typeFilterSet
- * @param type type of event
- * @param open true: opened, false: closed
- */
- private void setType(TypeFilterSet typeFilterSet, int type, Boolean open)
- {
- typeFilterSet.addEntry(type, open);
- }
-
- /**
- * Open type in one TypeFilterSet
- * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
- * @param type type of event
- */
- public void setTypeOpened(int index, int type)
- {
- setType(typeFilters.get(index), type, true);
- }
-
- /**
- * Close type in one TypeFilterSet
- * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
- * @param type type of event
- */
- public void setTypeClosed(int index, int type)
- {
- setType(typeFilters.get(index), type, false);
- }
-
- /**
- * Open or close bundle in one IdFilterSet
- * @param idBundle
- * @param mode true: opened, false: closed
- */
- private void setId(long idBundle, boolean mode)
- {
- idFilter.addEntry(idBundle, mode);
- }
-
- /**
- * Open bundle in one IdFilterSet
- * @param idBundle
- */
- public void setIdOpened(long idBundle)
- {
- setId(idBundle, true);
- }
-
- /**
- * Close bundle in one IdFilterSet
- * @param idBundle
- */
- public void setIdClosed(long idBundle)
- {
- setId(idBundle, false);
- }
-
- /**
- * Add a new field and class to be instrumented
- * @param s format: "field/class"
- */
- public void addField(String s)
- {
- String[] ss = s.split("/");
- if(ss.length == 2)
- {
- if(((DataFieldMonitor)bundleMonitors.get(3)).addDataField(ss[0], ss[1]))
- {
- setChanged();
- notifyObservers(new FieldEvent(ss[0], ss[1]));
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
- */
- @Override
- public void update(Observable obs, Object obj)
- {
- setChanged();
- notifyObservers(obj);
- }
-
- /**
- * Unregisters necessary services for DataFieldMonitor
- */
- public void uniregisterServices()
- {
- ((DataFieldMonitor)bundleMonitors.get(3)).unregisterWeavingService();
- }
-
-}
+package osgi.bundle.monitoring.dem1.model;
+
+import java.util.ArrayList;
+import java.util.Observable;
+import java.util.Observer;
+
+import org.osgi.framework.BundleContext;
+
+import osgi.framework.monitoring.event.DataFieldMonitor;
+import osgi.framework.monitoring.event.ManifestMonitor;
+import osgi.framework.monitoring.event.RepositoryMonitor;
+import osgi.framework.monitoring.event.StateMonitor;
+import osgi.framework.monitoring.event.EventMonitor;
+import osgi.framework.monitoring.event.filter.IdFilterSet;
+import osgi.framework.monitoring.event.filter.TypeFilterSet;
+
+/**
+ * Manages the different types of monitors: repository monitor, state monitor,
+ * manifest monitor and data field monitor
+ * @author Anibal
+ */
+public class Monitor extends Observable implements Observer
+{
+ // Contains all monitor objects
+ private ArrayList bundleMonitors;
+
+ // Contains all type filer for the various monitors
+ private ArrayList typeFilters;
+
+ private IdFilterSet idFilter;
+
+ /**
+ * Constructor. Initialize the different monitors
+ * @param bundleContext
+ */
+ public Monitor(BundleContext bundleContext)
+ {
+ bundleMonitors = new ArrayList();
+
+ typeFilters = new ArrayList();
+
+ idFilter = new IdFilterSet();
+
+ // Positions in array 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
+ bundleMonitors.add(new RepositoryMonitor(bundleContext));
+ bundleMonitors.add(new StateMonitor(bundleContext));
+ bundleMonitors.add(new ManifestMonitor(bundleContext));
+ bundleMonitors.add(new DataFieldMonitor(bundleContext));
+
+ // Set the type filter sets to each monitor object
+ for(int i = 0; i < bundleMonitors.size() - 1; i++)
+ {
+ typeFilters.add(new TypeFilterSet());
+ bundleMonitors.get(i).setTypeFilterSet(typeFilters.get(i));
+ bundleMonitors.get(i).setBundleFilterSet(idFilter);
+ }
+
+ // Registers necessary services for DataFieldMonitor
+ ((DataFieldMonitor)bundleMonitors.get(3)).registerWeavingService();
+
+ // StateMonitor activated by default
+ setMonitorOn(1);
+ }
+
+ /**
+ * Activate monitor object
+ * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
+ */
+ public void setMonitorOn(int index)
+ {
+ bundleMonitors.get(index).addObserver(this);
+ }
+
+ /**
+ * Deactivate monitor object
+ * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
+ */
+ public void setMonitorOff(int index)
+ {
+ bundleMonitors.get(index).deleteObservers();
+ }
+
+ /**
+ * Open or close type in one TypeFilterSet
+ * @param typeFilterSet
+ * @param type type of event
+ * @param open true: opened, false: closed
+ */
+ private void setType(TypeFilterSet typeFilterSet, int type, Boolean open)
+ {
+ typeFilterSet.addEntry(type, open);
+ }
+
+ /**
+ * Open type in one TypeFilterSet
+ * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
+ * @param type type of event
+ */
+ public void setTypeOpened(int index, int type)
+ {
+ setType(typeFilters.get(index), type, true);
+ }
+
+ /**
+ * Close type in one TypeFilterSet
+ * @param index 0: RepositoryMonitor, 1: StateMonitor, 2: ManifestMonitor, 3: DataFieldMonitor
+ * @param type type of event
+ */
+ public void setTypeClosed(int index, int type)
+ {
+ setType(typeFilters.get(index), type, false);
+ }
+
+ /**
+ * Open or close bundle in one IdFilterSet
+ * @param idBundle
+ * @param mode true: opened, false: closed
+ */
+ private void setId(long idBundle, boolean mode)
+ {
+ idFilter.addEntry(idBundle, mode);
+ }
+
+ /**
+ * Open bundle in one IdFilterSet
+ * @param idBundle
+ */
+ public void setIdOpened(long idBundle)
+ {
+ setId(idBundle, true);
+ }
+
+ /**
+ * Close bundle in one IdFilterSet
+ * @param idBundle
+ */
+ public void setIdClosed(long idBundle)
+ {
+ setId(idBundle, false);
+ }
+
+ /**
+ * Add a new field and class to be instrumented
+ * @param s format: "field/class"
+ */
+ public void addField(String s)
+ {
+ String[] ss = s.split("/");
+ if(ss.length == 2)
+ {
+ if(((DataFieldMonitor)bundleMonitors.get(3)).addDataField(ss[0], ss[1]))
+ {
+ setChanged();
+ notifyObservers(new FieldEvent(ss[0], ss[1]));
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
+ */
+ @Override
+ public void update(Observable obs, Object obj)
+ {
+ setChanged();
+ notifyObservers(obj);
+ }
+
+ /**
+ * Unregisters necessary services for DataFieldMonitor
+ */
+ public void uniregisterServices()
+ {
+ ((DataFieldMonitor)bundleMonitors.get(3)).unregisterWeavingService();
+ }
+
+}
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTable.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTable.java
index 18ab980..d313a9a 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTable.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTable.java
@@ -1,136 +1,136 @@
-package osgi.bundle.monitoring.dem1.view;
-
-import java.awt.Dimension;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleEvent;
-
-public class BundleTable extends JScrollPane
-{
-
- private static final long serialVersionUID = 1L;
-
- JTable bundleTable;
-
- BundleTableModel tableModel;
-
- public BundleTable(int x, int y)
- {
- tableModel = new BundleTableModel();
-
- bundleTable = new JTable(tableModel);
- bundleTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- bundleTable.getColumnModel().getColumn(0).setPreferredWidth(75);
- bundleTable.getColumnModel().getColumn(1).setPreferredWidth(75);
- bundleTable.getColumnModel().getColumn(2).setPreferredWidth(150);
- bundleTable.getColumnModel().getColumn(3).setPreferredWidth(300);
-
- setViewportView(bundleTable);
- setPreferredSize(new Dimension(x, y));
- }
-
- private String getBundleState(int state)
- {
- switch(state)
- {
- case Bundle.UNINSTALLED:
- return "Uninstalled";
- case Bundle.INSTALLED:
- return "Installed";
- case Bundle.RESOLVED:
- return "Resolved";
- case Bundle.STARTING:
- return "Starting";
- case Bundle.STOPPING:
- return "Stopping";
- case Bundle.ACTIVE:
- return "Active";
- }
-
- return "Unknown";
- }
-
- private void addBundle(Bundle bundle)
- {
- tableModel.insertRow(true,
- bundle.getBundleId(),
- getBundleState(bundle.getState()),
- bundle.getSymbolicName());
- }
-
- private void modifyBundle(Bundle bundle)
- {
- tableModel.modifyState(bundle.getBundleId(),
- getBundleState(bundle.getState()));
- }
-
- private void removeBundle(long id)
- {
- tableModel.deleteRow(id);
- }
-
- public void changeBundle(BundleEvent be)
- {
- switch(be.getType())
- {
- case BundleEvent.INSTALLED:
- addBundle(be.getBundle());
- break;
- case BundleEvent.LAZY_ACTIVATION:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.RESOLVED:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.STARTED:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.STARTING:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.STOPPED:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.STOPPING:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.UNINSTALLED:
- removeBundle(be.getBundle().getBundleId());
- break;
- case BundleEvent.UNRESOLVED:
- modifyBundle(be.getBundle());
- break;
- case BundleEvent.UPDATED:
- modifyBundle(be.getBundle());
- break;
- }
- }
-
- public long getSelectedBundleId()
- {
- int index = bundleTable.getSelectedRow();
-
- if(index >= 0)
- {
- return tableModel.idOfRow(index);
- }
-
- return -1;
- }
-
- public void checkMonitor(long id)
- {
- tableModel.modifyMonitoring(id, true);
- }
-
- public void uncheckMonitor(long id)
- {
- tableModel.modifyMonitoring(id, false);
- }
-
+package osgi.bundle.monitoring.dem1.view;
+
+import java.awt.Dimension;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+
+public class BundleTable extends JScrollPane
+{
+
+ private static final long serialVersionUID = 1L;
+
+ JTable bundleTable;
+
+ BundleTableModel tableModel;
+
+ public BundleTable(int x, int y)
+ {
+ tableModel = new BundleTableModel();
+
+ bundleTable = new JTable(tableModel);
+ bundleTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ bundleTable.getColumnModel().getColumn(0).setPreferredWidth(75);
+ bundleTable.getColumnModel().getColumn(1).setPreferredWidth(75);
+ bundleTable.getColumnModel().getColumn(2).setPreferredWidth(150);
+ bundleTable.getColumnModel().getColumn(3).setPreferredWidth(300);
+
+ setViewportView(bundleTable);
+ setPreferredSize(new Dimension(x, y));
+ }
+
+ private String getBundleState(int state)
+ {
+ switch(state)
+ {
+ case Bundle.UNINSTALLED:
+ return "Uninstalled";
+ case Bundle.INSTALLED:
+ return "Installed";
+ case Bundle.RESOLVED:
+ return "Resolved";
+ case Bundle.STARTING:
+ return "Starting";
+ case Bundle.STOPPING:
+ return "Stopping";
+ case Bundle.ACTIVE:
+ return "Active";
+ }
+
+ return "Unknown";
+ }
+
+ private void addBundle(Bundle bundle)
+ {
+ tableModel.insertRow(true,
+ bundle.getBundleId(),
+ getBundleState(bundle.getState()),
+ bundle.getSymbolicName());
+ }
+
+ private void modifyBundle(Bundle bundle)
+ {
+ tableModel.modifyState(bundle.getBundleId(),
+ getBundleState(bundle.getState()));
+ }
+
+ private void removeBundle(long id)
+ {
+ tableModel.deleteRow(id);
+ }
+
+ public void changeBundle(BundleEvent be)
+ {
+ switch(be.getType())
+ {
+ case BundleEvent.INSTALLED:
+ addBundle(be.getBundle());
+ break;
+ case BundleEvent.LAZY_ACTIVATION:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.RESOLVED:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.STARTED:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.STARTING:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.STOPPED:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.STOPPING:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.UNINSTALLED:
+ removeBundle(be.getBundle().getBundleId());
+ break;
+ case BundleEvent.UNRESOLVED:
+ modifyBundle(be.getBundle());
+ break;
+ case BundleEvent.UPDATED:
+ modifyBundle(be.getBundle());
+ break;
+ }
+ }
+
+ public long getSelectedBundleId()
+ {
+ int index = bundleTable.getSelectedRow();
+
+ if(index >= 0)
+ {
+ return tableModel.idOfRow(index);
+ }
+
+ return -1;
+ }
+
+ public void checkMonitor(long id)
+ {
+ tableModel.modifyMonitoring(id, true);
+ }
+
+ public void uncheckMonitor(long id)
+ {
+ tableModel.modifyMonitoring(id, false);
+ }
+
}
\ No newline at end of file
diff --git a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTableModel.java b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTableModel.java
index 232290b..276cd38 100644
--- a/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTableModel.java
+++ b/osgi.bundle.monitoring.dem1/src/osgi/bundle/monitoring/dem1/view/BundleTableModel.java
@@ -1,143 +1,143 @@
-package osgi.bundle.monitoring.dem1.view;
-
-import java.util.ArrayList;
-
-import javax.swing.table.AbstractTableModel;
-
-public class BundleTableModel extends AbstractTableModel
-{
-
- private static final long serialVersionUID = 1L;
-
- private String[] columnNames =
- {"Monitoring",
- "Id",
- "State",
- "Symbolic Name"
- };
-
- private ArrayList> data;
-
- public BundleTableModel()
- {
- data = new ArrayList>();
- }
-
- @Override
- public int getColumnCount()
- {
- return columnNames.length;
- }
-
- @Override
- public int getRowCount()
- {
- return data.size();
- }
-
- public String getColumnName(int col)
- {
- return columnNames[col];
- }
-
- @Override
- public Object getValueAt(int row, int col)
- {
- return data.get(row).get(col);
- }
-
- public Class> getColumnClass(int col)
- {
- return getValueAt(0, col).getClass();
- }
-
- public void setValueAt(Object value, int row, int col)
- {
- if(row == data.size())
- {
- data.add(new ArrayList