Package org.apache.karaf.eik.workbench.provider

Examples of org.apache.karaf.eik.workbench.provider.BundleItem


                idToBundleMap.clear();
            }

            for (final Object o : rawBundleData.values()) {
                final CompositeData composite = (CompositeData) o;
                final BundleItem bundle = new BundleItem(composite);

                synchronized (bundleSet) {
                    bundleSet.add(bundle);
                    idToBundleMap.put(bundle.getIdentifier(), bundle);
                }

                monitor.worked(1);

                if (monitor.isCanceled()) {
View Full Code Here


            if (columnIndex == 0) {
                final String[] interfaces = service.getServiceInterfaces();
                Arrays.sort(interfaces);
                label = arrayToString(interfaces);
            } else {
                final BundleItem bundle = (BundleItem) service.getAdapter(BundleItem.class);
                if (bundle != null) {
                    label = bundle.getSymbolicName();
                } else {
                    label = LABEL_ERROR;
                }
            }
        } else if (element instanceof PropertyEntry) {
View Full Code Here

        public String getColumnText(final Object element, final int columnIndex) {
            if (!(element instanceof BundleItem)) {
                return "";
            }

            final BundleItem bundle = (BundleItem) element;
            String label;

            switch (columnIndex) {
            case 0:
                label = bundle.getSymbolicName();
                break;
            case 1:
                label = Long.toString(bundle.getIdentifier());
                break;
            case 2:
                label = bundle.getState();
                break;
            case 3:
                label = bundle.getLocation();
                break;
            default:
                label = "";
            }
View Full Code Here

    public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof RuntimeDataProvider) {
            return true;
        }

        final BundleItem bundle = (BundleItem) element;

        return bundle.getState().equals(state) == false;
    }
View Full Code Here

        }

        final ServiceItem lhs = (ServiceItem) e1;
        final ServiceItem rhs = (ServiceItem) e2;

        final BundleItem lhsBundle = (BundleItem) lhs.getAdapter(BundleItem.class);
        final BundleItem rhsBundle = (BundleItem) rhs.getAdapter(BundleItem.class);

        if (lhsBundle == null && rhsBundle == null) {
            return 0;
        } else if (lhsBundle == null) {
            return -1;
        } else if (rhsBundle == null) {
            return 1;
        } else {
            int value = lhsBundle.getSymbolicName().compareTo(rhsBundle.getSymbolicName());

            if (value == 0) {
                value = lhs.getServiceInterfaces()[0].compareTo(rhs.getServiceInterfaces()[0]);
            }
View Full Code Here

            }

            return "";
        }

        final BundleItem bundle = (BundleItem) element;
        String label;

        switch (columnIndex) {
        case 1:
            label = Long.toString(bundle.getIdentifier());
            break;
        case 2:
            label = bundle.getState();
            break;
        case 3:
            label = bundle.getSymbolicName();
            break;
        case 4:
            label = bundle.getLocation();
            break;
        default:
            label = "";
        }
View Full Code Here

                    if (b == null || b.getBundleContext() == null) {
                        continue;
                    }

                    synchronized (bundleSet) {
                        bundleSet.add(new BundleItem(b, startLevel, packageAdmin));
                    }

                    monitor.worked(1);
                }
View Full Code Here

    public int compare(Viewer viewer, Object e1, Object e2) {
        if (e1 instanceof BundleItem == false || e2 instanceof BundleItem == false) {
            return 0;
        }

        final BundleItem b1 = (BundleItem) e1;
        final BundleItem b2 = (BundleItem) e2;

        return compareBundles(b1, b2);
    }
View Full Code Here

    private final class EclipseBundleListener implements BundleListener {

        @Override
        public void bundleChanged(BundleEvent event) {
            final BundleItem wrappedBundle = new BundleItem(event.getBundle(), startLevel, packageAdmin);

            EnumSet<RuntimeDataProviderListener.EventType> events = EnumSet.noneOf(RuntimeDataProviderListener.EventType.class);

            switch (event.getType()) {
            case BundleEvent.INSTALLED:
View Full Code Here

          return true;
      } else if (!(element instanceof BundleItem)) {
          return false;
      }

      final BundleItem bundle = (BundleItem) element;

    return bundle.getSymbolicName().toLowerCase().indexOf(filterString) > -1;
  }
View Full Code Here

TOP

Related Classes of org.apache.karaf.eik.workbench.provider.BundleItem

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.