Package org.eclipse.ui.internal.StartupThreading

Examples of org.eclipse.ui.internal.StartupThreading.StartupRunnable


                WorkbenchMessages.RootLayoutContainer_problemsRestoringPerspective, null);

        // Remove the default editor workbook that is
        // initialy created with the editor area.
        if (children != null) {
          StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() throws Throwable {
          EditorStack defaultWorkbook = null;
                for (int i = 0; i < children.size(); i++) {
                    LayoutPart child = (LayoutPart) children.get(i);
                    if (child.getID() == DEFAULT_WORKBOOK_ID) {
                        defaultWorkbook = (EditorStack) child;
                        if (defaultWorkbook.getItemCount() > 0) {
                defaultWorkbook = null;
              }
                    }
                }
                if (defaultWorkbook != null) {
            remove(defaultWorkbook);
          }
        }});
           
        }

        // Restore the relationship/layout
        IMemento[] infos = memento.getChildren(IWorkbenchConstants.TAG_INFO);
        final Map mapIDtoPart = new HashMap(infos.length);

        for (int i = 0; i < infos.length; i++) {
            // Get the info details.
            IMemento childMem = infos[i];
            final String partID = childMem.getString(IWorkbenchConstants.TAG_PART);
            final String relativeID = childMem
                    .getString(IWorkbenchConstants.TAG_RELATIVE);
            int relationship = 0;
            int left = 0, right = 0;
            float ratio = 0.5f;
            if (relativeID != null) {
                relationship = childMem.getInteger(
                        IWorkbenchConstants.TAG_RELATIONSHIP).intValue();
                Float ratioFloat = childMem
                        .getFloat(IWorkbenchConstants.TAG_RATIO);
                Integer leftInt = childMem
                        .getInteger(IWorkbenchConstants.TAG_RATIO_LEFT);
                Integer rightInt = childMem
                        .getInteger(IWorkbenchConstants.TAG_RATIO_RIGHT);
                if (leftInt != null && rightInt != null) {
                    left = leftInt.intValue();
                    right = rightInt.intValue();
                } else if (ratioFloat != null) {
                    ratio = ratioFloat.floatValue();
                }
            }

            final EditorStack workbook [] = new EditorStack[1];
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() throws Throwable {
          // Create the part.
                workbook[0] = EditorStack.newEditorWorkbook(EditorSashContainer.this, page);
                workbook[0].setID(partID);
                // 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
                workbook[0].setContainer(EditorSashContainer.this);
        }});
           

            IMemento workbookMemento = childMem
                    .getChild(IWorkbenchConstants.TAG_FOLDER);
            if (workbookMemento != null) {
                result.add(workbook[0].restoreState(workbookMemento));
            }

            final int myLeft = left, myRight = right, myRelationship = relationship;
            final float myRatio = ratio;
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() throws Throwable {
          // Add the part to the layout
                if (relativeID == null) {
                    add(workbook[0]);
View Full Code Here


            if (memento == null) {
        continue;
      }
            final PresentationSerializer serializer = new PresentationSerializer(
                    workbook.getPresentableParts());
            StartupThreading.runWithoutExceptions(new StartupRunnable(){

        public void runWithException() throws Throwable {
           workbook.getPresentation().restoreState(serializer, memento);
        }});
          
View Full Code Here

        if (attributes != null) {
      size = attributes.getChild(IWorkbenchConstants.TAG_ITEM_SIZE);
    }
        if (size != null && currentLocation == TOP_RIGHT && topBar != null) {
            final Integer x = size.getInteger(IWorkbenchConstants.TAG_X);
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() {
          if (x != null) {
            topBar.setRightWidth(x.intValue());
          } else {
View Full Code Here

    if (Thread.currentThread() == display.getThread())
      r.run(); // run immediatley if we're on the UI thread
    else {
      // wrapper with a StartupRunnable to ensure that it will run before
      // the UI is fully initialized
      StartupRunnable startupRunnable = new StartupRunnable() {

        public void runWithException() throws Throwable {
          r.run();
        }
      };
View Full Code Here

      public void run() {
        try {
          //declare us to be a startup thread so that our syncs will be executed
          UISynchronizer.startupThread.set(Boolean.TRUE);
          final IWorkbenchConfigurer [] myConfigurer = new IWorkbenchConfigurer[1];
          StartupThreading.runWithoutExceptions(new StartupRunnable() {
 
            public void runWithException() throws Throwable {
              myConfigurer[0] = getWorkbenchConfigurer();
             
            }});
View Full Code Here

        final NavigationHistoryEntry entry = getEntry(activeEntry);
        if (entry != null && entry.editorInfo.editorInput != null) {
            if (page.getActiveEditor() == page
                    .findEditor(entry.editorInfo.editorInput)) {
              StartupThreading.runWithoutExceptions(new StartupRunnable() {

          public void runWithException() throws Throwable {
            gotoEntry(entry);
          }});   
      }
View Full Code Here

            // the load methods can touch on WorkbenchImages if an image is
      // missing so we need to wrap the call in
      // a startup block for the case where a custom descriptor exists on
      // startup that does not have an image
      // associated with it. See bug 196352.
      StartupThreading.runWithoutExceptions(new StartupRunnable() {
        public void runWithException() throws Throwable {
          perspRegistry.load();
        }
      });
           
View Full Code Here

        IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore();
        boolean useNewMinMax = preferenceStore.getBoolean(IWorkbenchPreferenceConstants.ENABLE_NEW_MIN_MAX);
        final Integer expanded = memento.getInteger(IWorkbenchConstants.TAG_EXPANDED);
        if (useNewMinMax && expanded != null) {
            StartupThreading.runWithoutExceptions(new StartupRunnable() {
          public void runWithException() throws Throwable {               
                setState((expanded == null || expanded.intValue() != IStackPresentationSite.STATE_MINIMIZED) ? IStackPresentationSite.STATE_RESTORED
                        : IStackPresentationSite.STATE_MINIMIZED);
          }
            });
View Full Code Here

      PartStack maxStack = page.getActivePerspective().getPresentation().getMaximizedStack();
      useNewMinMax = useNewMinMax && maxStack == this;
    }

    if (useNewMinMax) {
          StartupThreading.runWithoutExceptions(new StartupRunnable() {
        public void runWithException() throws Throwable {
          wbw.getPageComposite().setRedraw(false);
          try {
            if (newState == IStackPresentationSite.STATE_MAXIMIZED) {
              smartZoom();
View Full Code Here

        final String factoryId = ((Workbench) window.getWorkbench())
                .getPresentationId();

        if (factoryId != null && factoryId.length() > 0) {
            final AbstractPresentationFactory [] factory = new AbstractPresentationFactory[1];
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() throws Throwable {
          factory[0] = WorkbenchPlugin.getDefault()
              .getPresentationFactory(factoryId);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.StartupThreading.StartupRunnable

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.