Package org.eclipse.swt

Examples of org.eclipse.swt.SWTException


    }

    public void runWithProgress( boolean mayBlock, final IRunnableWithProgress runnable )
            throws InvocationTargetException, InterruptedException {
        if (Display.getCurrent() == null)
            throw new SWTException(SWT.ERROR_THREAD_INVALID_ACCESS);
        final ProgressMonitorPart part = new ProgressMonitorPart(progressArea, new GridLayout(
                1, true), 10);
        try {
            progressArea.layout();
            PlatformGIS.runBlockingOperation(runnable, part);
View Full Code Here


    @SuppressWarnings("unchecked")
    @Override
    public Collection getChildren( Object object ) {
        if( Display.getCurrent()==null )
            throw new SWTException("Invalid Thread access, not in UI thread."); //$NON-NLS-1$
          
        if (!getChildFetcher().dataReady) {
          getChildFetcher().parent = object;
          getChildFetcher().schedule();
          return getChildFetcher().getChildren();
View Full Code Here

            // http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg30856.html
            StackTraceElement[] stack = e.getStackTrace();
            if (stack.length > 0
                    && "org.eclipse.swt.widgets.Display".equals(stack[0].getClassName())
                    && "asyncExec".equals(stack[0].getMethodName())) {
                SWTException swte = new SWTException(SWT.ERROR_DEVICE_DISPOSED);
                swte.throwable = e;
                throw swte;
            } else
                throw e;
        }
View Full Code Here

        if (fontRecord == null) {
      fontRecord = defaultFontRecord();
      if (Display.getCurrent() == null) { // log error but don't throw an exception to preserve existing functionality
        String msg = "Unable to create font \"" + symbolicName + "\" in a non-UI thread. Using default font instead."; //$NON-NLS-1$ //$NON-NLS-2$
        Policy.logException(new SWTException(msg));
        return fontRecord; // don't add it to the cache; if later asked from UI thread, a proper font will be created
      }
    }

        stringToFontRecord.put(symbolicName, fontRecord);
View Full Code Here

    }
   
    Composite parent = control.getParent();
   
    if (parent != this) {
      throw new SWTException(SWT.ERROR_INVALID_PARENT, MessageFormat.format("Cannot compute bounds for control {0}.", control));
    }
   
    if (controls.contains(control)) {
      throw new ControlAlreadyDockedException(MessageFormat.format("The control {0} is already docked.", control));
    }
View Full Code Here

          entry = new ImageEntry(single);
        }
       
        getStore().put(url, entry);
      } catch (IOException ex) {
        throw new SWTException(SWT.ERROR_IO, ex.toString());
      }
    }
   
    entry.incrementCounter();
    return entry.getImages();
View Full Code Here

        if (rtype == Image.class) {
          URL url = getClass().getResource(path + ".png");
         
          if (url == null) {
            System.out.println(path + ".png");
            throw new SWTException(SWT.ERROR_IO,
              MessageFormat.format("Image \"{0}\" not found.",
              name));
          }
         
          return lease(url)[0];
        }
       
        if (rtype == Image[].class) {
          URL url = getClass().getResource(path + ".zip");
         
          if (url == null) {
            throw new SWTException(SWT.ERROR_IO,
              MessageFormat.format("Image \"{0}\" not found.",
              name));
          }
         
          return lease(url);
        }
       
        throw new SWTException(SWT.ERROR_IO, MessageFormat.format(
          "Invalid method to get image \"{0}\".", method));
      }
    }.createProxy();
  }
View Full Code Here

    String message = ImageAnalyzer.createMsg(ImageAnalyzer.bundle.getString("Error"), new String[] { operation,
        filename });
    String errorMessage = "";
    if (e != null)
      if (e instanceof SWTException) {
        SWTException swte = (SWTException) e;
        errorMessage = swte.getMessage();
        if (swte.throwable != null)
          errorMessage += ":\n" + swte.throwable.toString();
      } else if (e instanceof SWTError) {
        SWTError swte = (SWTError) e;
        errorMessage = swte.getMessage();
        if (swte.throwable != null)
          errorMessage += ":\n" + swte.throwable.toString();
      } else
        errorMessage = e.toString();
    box.setMessage(message + errorMessage);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.SWTException

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.