Package org.knopflerfish.service.desktop

Examples of org.knopflerfish.service.desktop.SwingBundleDisplayer


        new ServiceTracker(Activator.getBC(),
                           Activator.getBC().createFilter(dispFilter),
                           null)
        {
          public Object addingService(final ServiceReference sr) {
            final SwingBundleDisplayer disp =
              (SwingBundleDisplayer)super.addingService(sr);

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {

                  Icon   icon = disp.getSmallIcon();

                  String  name =
                    Util.getStringProp(sr,
                                       SwingBundleDisplayer.PROP_NAME,
                                       disp.getClass().getName());
                  String  desc =
                    Util.getStringProp(sr,
                                       SwingBundleDisplayer.PROP_DESCRIPTION,
                                       "");

                  boolean bDetail    =
                    Util.getBooleanProp(sr,
                                        SwingBundleDisplayer.PROP_ISDETAIL,
                                        false);

                  JComponent comp = disp.createJComponent();

                  JFloatable wrapper = new JFloatable(comp, name);

                  // floating windows shouldn't be closed when
                  // the tabbed pane swaps components
                  wrapper.setAutoClose(false);

                  disp.setBundleSelectionModel(bundleSelModel);

                  if(bDetail) {
                    detailMap.put(sr, disp);

                    //              JPanel wrapper2 = new JPanel(new BorderLayout());
                    //              wrapper2.add(wrapper, BorderLayout.CENTER);

                    detailPanel.addTab(name, icon, wrapper, desc);
                  } else {
                    displayMap.put(sr, disp);

                    bundlePanel.addTab(name, wrapper);

                    makeViewPopupMenu();

                    viewMenu = makeViewMenu(viewMenu);
                  }

                }
              });
            return disp;
          }

          public void removedService(final ServiceReference sr,
                                     final Object service) {
            final SwingBundleDisplayer disp = (SwingBundleDisplayer)service;
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                  String  name =
                    Util.getStringProp(sr,
                                       SwingBundleDisplayer.PROP_NAME,
                                       disp.getClass().getName());
                  boolean bDetail    =
                    Util.getBooleanProp(sr,
                                        SwingBundleDisplayer.PROP_ISDETAIL,
                                        false);
View Full Code Here


  // try to show a bundle in displayers
  public void showBundle(Bundle b) {
    Object[] disps = dispTracker.getServices();
    for(int i = 0; disps != null && i < disps.length; i++) {
      SwingBundleDisplayer disp = (SwingBundleDisplayer)disps[i];
      disp.showBundle(b);
    }
  }
View Full Code Here

TOP

Related Classes of org.knopflerfish.service.desktop.SwingBundleDisplayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.