Examples of ISafeRunnable


Examples of org.eclipse.core.runtime.ISafeRunnable

        public void selectionChanged( IWorkbenchPart part, final ISelection selection ) {
            if (part == MapEditor.this || getSite().getPage().getActivePart() != part
                    || selection instanceof IBlockingSelection)
                return;

            ISafeRunnable sendAnimation = new ISafeRunnable(){
                public void run() {
                    if (selection instanceof IStructuredSelection) {
                        IStructuredSelection s = (IStructuredSelection) selection;
                        List<SimpleFeature> features = new ArrayList<SimpleFeature>();
                        for( Iterator iter = s.iterator(); iter.hasNext(); ) {
                            Object element = iter.next();

                            if (element instanceof SimpleFeature) {
                                SimpleFeature feature = (SimpleFeature) element;
                                features.add(feature);
                            }
                        }
                        if (features.size() == 0)
                            return;
                        if (!getRenderManager().isDisposed()) {
                            IAnimation anim = createAnimation(features);
                            if (anim != null)
                                AnimationUpdater.runTimer(getMap().getRenderManager()
                                        .getMapDisplay(), anim);
                        }
                    }
                }
                public void handleException( Throwable exception ) {
                    ProjectUIPlugin.log("Exception preparing animation", exception); //$NON-NLS-1$
                }
            };

            try {
                sendAnimation.run();
            } catch (Exception e) {
                ProjectUIPlugin.log("", e); //$NON-NLS-1$
            }
            // PlatformGIS.run(sendAnimation);
        }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

            } catch (Throwable t) {
                ProjectUIPlugin.log("Shutting down rendering - " + t, null);
            }
            getMap().getEditManagerInternal().setEditFeature(null, null);
            try {
                PlatformGIS.run(new ISafeRunnable(){

                    public void handleException( Throwable exception ) {
                        ProjectUIPlugin.log("error saving map: " + getMap().getName(), exception); //$NON-NLS-1$
                    }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

    private boolean isUnknownCRS() {
        unknownCRSLock.lock();
        try {
            if (unknownCRS == null) {
                if (crsLoader == null) {
                    crsLoader = new ISafeRunnable() {

                        public void handleException(Throwable exception) {
                            ProjectPlugin.log("", exception); //$NON-NLS-1$
                        }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

         */
        @Override
        protected IStatus run(IProgressMonitor monitor) {
            current=monitor;
            while( requests.size() > 0){
                ISafeRunnable runnable=requests.get(0);
                requests.remove(0);
                run(runnable);
            }
            return Status.OK_STATUS;
        }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

    IStructuredSelection current;
    public void run( IAction action ) {
        if ((current == null)) {
            return;
        }
        PlatformGIS.run(new ISafeRunnable(){

            public void handleException( Throwable exception ) {
                CatalogUIPlugin.log("Error resetting: "+current, exception); //$NON-NLS-1$
            }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

        }
        return null;
    }

    private void reset( final IStructuredSelection context ) {
        PlatformGIS.run(new ISafeRunnable(){

            public void handleException( Throwable exception ) {
                CatalogUIPlugin.log("Error resetting: "+context, exception); //$NON-NLS-1$
            }
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

    }
  }

  private void run(final MessageHandler handler, final BufferedReader reader,
      final Socket socket) {
    PlatformGIS.run(new ISafeRunnable() {

      public void handleException(Throwable exception) {
        Activator.log(handler.getClass().getName()
            + " failed in handling communications", //$NON-NLS-1$
            exception);
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

    currentPage.setContainer(this);
    // Ensure that the page control has been created
    // (this allows lazy page control creation)
    if (currentPage.getControl() == null) {
      final boolean[] failed = { false };
      SafeRunnable.run(new ISafeRunnable() {
        public void handleException(Throwable e) {
          failed[0] = true;
        }

        public void run() {
          createPageControl(currentPage, pageContainer);
        }
      });
      if (failed[0])
        return false;
      // the page is responsible for ensuring the created control is
      // accessable
      // via getControl.
      Assert.isNotNull(currentPage.getControl());
    }
    // Force calculation of the page's description label because
    // label can be wrapped.
    final Point[] size = new Point[1];
    final Point failed = new Point(-1, -1);
    SafeRunnable.run(new ISafeRunnable() {
      public void handleException(Throwable e) {
        size[0] = failed;
      }

      public void run() {
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

     */
    protected void runModeless() {
        if (type != ACTION) {
            throw new IllegalStateException("runModeless expects ACTION");
        }
        PlatformGIS.run(new ISafeRunnable(){
            public void run() throws Exception {
                getModelessTool().run();
            }
            public void handleException( Throwable exception ) {
                ProjectUIPlugin
View Full Code Here

Examples of org.eclipse.core.runtime.ISafeRunnable

        public void selectionChanged( IWorkbenchPart part, final ISelection selection ) {
            if (part == MapEditorWithPalette.this || getSite().getPage().getActivePart() != part
                    || selection instanceof IBlockingSelection)
                return;

            ISafeRunnable sendAnimation = new ISafeRunnable(){
                public void run() {
                    if (selection instanceof IStructuredSelection) {
                        IStructuredSelection s = (IStructuredSelection) selection;
                        List<SimpleFeature> features = new ArrayList<SimpleFeature>();
                        for( Iterator iter = s.iterator(); iter.hasNext(); ) {
                            Object element = iter.next();

                            if (element instanceof SimpleFeature) {
                                SimpleFeature feature = (SimpleFeature) element;
                                features.add(feature);
                            } else if (element instanceof IAdaptable) {
                                final IAdaptable adaptable = (IAdaptable) element;
                                final Object featureObj = adaptable.getAdapter(SimpleFeature.class);
                                if (featureObj != null && featureObj instanceof SimpleFeature) {
                                    final SimpleFeature feature = (SimpleFeature) featureObj;
                                    features.add(feature);
                                }
                            }
                        }
                        if (features.size() == 0)
                            return;
                        if (!getRenderManager().isDisposed()) {
                            IAnimation anim = createAnimation(features);
                            if (anim != null)
                                AnimationUpdater.runTimer(getMap().getRenderManager()
                                        .getMapDisplay(), anim);
                        }
                    }
                }
                public void handleException( Throwable exception ) {
                    ProjectUIPlugin.log("Exception preparing animation", exception); //$NON-NLS-1$
                }
            };

            try {
                sendAnimation.run();
            } catch (Exception e) {
                ProjectUIPlugin.log("", e); //$NON-NLS-1$
            }
            // PlatformGIS.run(sendAnimation);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.