@Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);
    int detailsState = IFlyoutPreferences.STATE_OPEN;
    int patternsState = IFlyoutPreferences.STATE_COLLAPSED;
    if (memento != null) {
      if (memento.getInteger(DETAILS_VIEW_FLYOUT_STATE) != null) {
        detailsState = memento.getInteger(DETAILS_VIEW_FLYOUT_STATE);
      }
      if (memento.getInteger(PATTERNS_VIEWER_FLYOUT_STATE) != null) {
        patternsState = memento.getInteger(DETAILS_VIEW_FLYOUT_STATE);
      }
      if (memento.getString(PACKAGE_PRESENTATION_STATE) != null) {
        mementoPackagePresentation = memento.getString(PACKAGE_PRESENTATION_STATE);
      }
    }
    detailsViewerFlyoutPreferences =
        new FlyoutPreferences(IFlyoutPreferences.DOCK_EAST, detailsState, 300);
    patternsViewerFlyoutPreferences =
        new FlyoutPreferences(IFlyoutPreferences.DOCK_WEST, patternsState, 100);

    IncQueryGUIPlugin.getDefault()
        .getPreferenceStore()
        .setDefault(PreferenceConstants.WILDCARD_MODE, true);
  }
  @Override
  public void init(IViewSite site) throws PartInitException {
    super.init(site);

    fViewCnt++;
    String secondaryId = site.getSecondaryId();
    if (secondaryId != null) MemoryViewIdRegistry.registerView(secondaryId);

    // only do this the first time
    // not sure if there is a bug in the UI... if the view is
    // not a primary view and if it's hidden, the view is not
    // init and created until it becomes visible.
    if (fViewCnt == 1) {
      // also try to find other views and register
      if (DebugUIPlugin.getActiveWorkbenchWindow() != null
          && DebugUIPlugin.getActiveWorkbenchWindow().getActivePage() != null) {
        IViewReference references[] =
            DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().getViewReferences();
        for (int i = 0; i < references.length; i++) {
          if (references[i].getSecondaryId() != null) {
            MemoryViewIdRegistry.registerView(references[i].getSecondaryId());
          }
        }
      }
    }

    fSyncService = new MemoryViewSynchronizationService();
  }
Ejemplo n.º 3
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite,
   * org.eclipse.ui.IMemento)
   */
  @Override
  public void init(final IViewSite site, final IMemento memento) throws PartInitException {
    // let the parent do its bits
    super.init(site, memento);

    final Vector<String> pendingFilenames = new Vector<String>();

    // are we showing the units column?
    if (memento != null) {
      final String scenFile = memento.getString(SCENARIO_FILE_INDEX);
      if (scenFile != null) {
        pendingFilenames.add(scenFile);
      }
      final String contFile = memento.getString(CONTROL_FILE_INDEX);
      if (contFile != null) {
        pendingFilenames.add(contFile);
      }

      // also, see if we have an auto-step size property
      final String stepSizeStr = memento.getString("StepInterval");
      if (stepSizeStr != null) {
        // and store it.
        try {
          final Double duration = MWCXMLReader.readThisDouble(stepSizeStr);
          _myPendingStepSize = new Duration(duration, Duration.MILLISECONDS);
        } catch (final ParseException pe) {
          MWC.Utilities.Errors.Trace.trace(pe);
        }
      }
    }

    // did we receive any?
    if (pendingFilenames.size() > 0)
      _myPendingFilenames = pendingFilenames.toArray(new String[] {});
  }
Ejemplo n.º 4
0
  @Override
  public void init(final IViewSite site, final IMemento memento) throws PartInitException {
    super.init(site, memento);

    if (memento != null) {
      try {
        String dbpath = memento.getString(KEY_DB);
        String itempath = memento.getString(KEY_ITEM);

        if (dbpath != null && itempath != null) {
          ILocalMixedMediaDb mmdb;
          mmdb = Activator.getMediaFactory().getLocalMixedMediaDb(dbpath);
          mmdb.read();
          IMediaPicture item = mmdb.getByFile(itempath);

          if (item != null) {
            setInput(mmdb, item);
          } else {
            // TODO something with this error.
            System.err.println("Failed to restore item '" + itempath + "' from '" + dbpath + "'.");
          }
        }
      } catch (Exception e) {
        new MorriganMsgDlg(e).open();
      }

      Boolean b = memento.getBoolean(KEY_TIMER);
      if (b == null || b.booleanValue()) { // Default to true.
        startTimer();
      }
    }
  }
Ejemplo n.º 5
0
 public void init(IViewSite site) throws PartInitException {
   super.init(site);
   String secId = site.getSecondaryId();
   if (secId != null) {
     serverId = Integer.parseInt(secId);
   }
 }
  /* (non-Javadoc)
   * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
   */
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site);
    Workbench workbench = (Workbench) site.getWorkbenchWindow().getWorkbench();
    try {
      introPart = workbench.getWorkbenchIntroManager().createNewIntroPart();
      // reset the part name of this view to be that of the intro title
      setPartName(introPart.getTitle());
      introPart.addPropertyListener(
          new IPropertyListener() {
            public void propertyChanged(Object source, int propId) {
              firePropertyChange(propId);
            }
          });
      introSite = new ViewIntroAdapterSite(site, workbench.getIntroDescriptor());
      introPart.init(introSite, memento);

    } catch (CoreException e) {
      WorkbenchPlugin.log(
          IntroMessages.Intro_could_not_create_proxy,
          new Status(
              IStatus.ERROR,
              WorkbenchPlugin.PI_WORKBENCH,
              IStatus.ERROR,
              IntroMessages.Intro_could_not_create_proxy,
              e));
    }
  }
Ejemplo n.º 7
0
  @Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);

    this.memento = memento;

    IWorkbenchSiteProgressService progressService =
        (IWorkbenchSiteProgressService)
            getViewSite().getAdapter(IWorkbenchSiteProgressService.class);

    if (progressService != null) {
      initProgressService(progressService);
    }

    getSite()
        .getPage()
        .addSelectionListener(
            new ISelectionListener() {
              @Override
              public void selectionChanged(IWorkbenchPart part, ISelection selection) {
                if (part != ProblemsView.this) {
                  focusOn(part, selection);
                }
              }
            });
  }
Ejemplo n.º 8
0
  @Override
  public void init(final IViewSite site, final IMemento memento) throws PartInitException {
    // do the parent bit
    super.init(site, memento);

    if (memento != null) {
      // now restore my state
      final String lastA = memento.getString(LAST_IP);
      if (lastA != null) _lastIPAddress = lastA;
    }
  }
Ejemplo n.º 9
0
  @Override
  public void init(IViewSite site) throws PartInitException {
    super.init(site);

    removeAllAction =
        new Action("Remove All", SharedImages.getImageDescriptor(SharedImages.DELETE_ALL)) {
          @Override
          public void run() {
            getHistory().getEvents().clear();
          }
        };

    getViewSite().getActionBars().getToolBarManager().add(removeAllAction);
  }
Ejemplo n.º 10
0
 @Override
 public void init(IViewSite site, IMemento memento) throws PartInitException {
   super.init(site, memento);
   if (memento != null) {
     fInitialConnections = new ArrayList<>();
     for (int i = 0; ; i++) {
       String id = memento.getString(KEY_REMOTE_PROVIDER + i);
       String name = memento.getString(KEY_REMOTE_CONNECTION_NAME + i);
       if ((id == null) || (name == null)) {
         break;
       }
       IRemoteConnection conn = TmfRemoteConnectionFactory.getRemoteConnection(id, name);
       if (conn != null) {
         fInitialConnections.add(conn);
       }
     }
   }
 }
Ejemplo n.º 11
0
 @Override
 public void init(IViewSite site) throws PartInitException {
   super.init(site);
   id = site.getId();
   sId = site.getSecondaryId();
   if (sId == null) {
     setPartName("Colour Mapping");
   } else {
     try {
       // You can see it's a histogram by looking but
       // you really need the file name to know which
       // view is corresponding to which file.
       setPartName("Colour Mapping: " + (new File(sId)).getName());
     } catch (Exception ne) {
       setPartName("Colour Mapping");
     }
   }
 }
Ejemplo n.º 12
0
  /* (non-Javadoc)
   * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
   */
  @Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);

    BundleContext bundleContext = UIActivator.getDefault().getBundle().getBundleContext();

    ServiceReference<ITradingSystemService> serviceReference =
        bundleContext.getServiceReference(ITradingSystemService.class);
    tradingSystemService = bundleContext.getService(serviceReference);

    activator = CoreActivator.getDefault();

    IDialogSettings rootDialogSettings = UIActivator.getDefault().getDialogSettings();
    dialogSettings = rootDialogSettings.getSection(VIEW_ID);
    if (dialogSettings == null) {
      dialogSettings = rootDialogSettings.addNewSection(VIEW_ID);
      dialogSettings.put(
          COLUMNS,
          new String[] {
            "org.eclipsetrader.ui.providers.LastTrade", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.BidPrice", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.AskPrice", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.Position", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.LastTradeDateTime", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.gain", //$NON-NLS-1$
          });
      IDialogSettings section = dialogSettings.addNewSection(COLUMN_NAMES);
      section.put("org.eclipsetrader.ui.providers.LastTrade", "Last"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.BidPrice", "Bid"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.AskPrice", "Ask"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.Position", "Position"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.LastTradeDateTime", "Date / Time"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.gain", "Gain"); // $NON-NLS-1$
      dialogSettings.addNewSection(COLUMN_WIDTHS);
    }

    settingsAction = new SettingsAction(site.getShell(), this);

    IActionBars actionBars = site.getActionBars();
    actionBars.setGlobalActionHandler(settingsAction.getId(), settingsAction);
    actionBars.updateActionBars();
  }
Ejemplo n.º 13
0
  @Override
  public void init(final IViewSite site, final IMemento memento) throws PartInitException {
    super.init(site, memento);

    // For new instances opened while CSS is running,
    // createNewInstance() tracks the secondary view ID.
    // But if this view was 'restored' from a saved workspace,
    // we need to adjust the instance counter to not re-use
    // IDs of restored views.
    int this_instance = 1;
    try {
      this_instance = Integer.parseInt(site.getSecondaryId());
    } catch (NumberFormatException ex) {
      // Ignore, just assume 1
    }
    synchronized (PVManagerProbe.class) {
      if (this_instance >= next_instance) next_instance = this_instance + 1;
    }

    // Save the memento
    this.memento = memento;
  }
Ejemplo n.º 14
0
 public void init(IViewSite site, IMemento memento) throws PartInitException {
   super.init(site, memento);
   initializeColoring();
 }
 /*
  * Implements method from IViewPart.
  */
 public void init(IViewSite site, IMemento memento) throws PartInitException {
   super.init(site, memento);
   fMemento = memento;
 }
 /**
  * Adds actions to the view
  *
  * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite)
  */
 @Override
 public void init(IViewSite site) throws PartInitException {
   super.init(site);
 }
Ejemplo n.º 17
0
 @Override
 public void init(IViewSite site, IMemento memento) throws PartInitException {
   super.init(site, memento);
   instance.parseMemento(memento);
 }
Ejemplo n.º 18
0
  /* (non-Javadoc)
   * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
   */
  @Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);

    this.memento = memento;
    this.preferenceStore = UIActivator.getDefault().getPreferenceStore();

    try {
      dialogSettings =
          UIActivator.getDefault()
              .getDialogSettings()
              .getSection(K_VIEWS)
              .getSection(site.getSecondaryId());
      uri = new URI(dialogSettings.get(K_URI));

      IRepositoryService repositoryService = UIActivator.getDefault().getRepositoryService();
      security = repositoryService.getSecurityFromURI(uri);

      String privateTemplate = dialogSettings.get(K_PRIVATE_TEMPLATE);
      if (privateTemplate != null) {
        template = unmarshal(privateTemplate);
      }

      if (template == null) {
        IPath templatePath = new Path("data"); // $NON-NLS-1$
        if (dialogSettings.get(K_TEMPLATE) != null) {
          templatePath = templatePath.append(dialogSettings.get(K_TEMPLATE));
        } else {
          templatePath = templatePath.append("basic-template.xml");
        }
        InputStream stream =
            FileLocator.openStream(UIActivator.getDefault().getBundle(), templatePath, false);
        template = unmarshal(stream);
      }
    } catch (Exception e) {
      Status status =
          new Status(
              IStatus.ERROR,
              UIActivator.PLUGIN_ID,
              Messages.ChartViewPart_LoadingErrorMessage + site.getSecondaryId(),
              e);
      UIActivator.getDefault().getLog().log(status);
    }

    site.setSelectionProvider(new SelectionProvider());

    createActions();
    createPeriodActions();

    IActionBars actionBars = site.getActionBars();

    IMenuManager menuManager = actionBars.getMenuManager();
    menuManager.add(new Separator("periods.top")); // $NON-NLS-1$
    menuManager.add(new Separator("periods")); // $NON-NLS-1$
    menuManager.add(new Separator("periods.bottom")); // $NON-NLS-1$
    menuManager.add(currentPriceLineAction);
    menuManager.add(currentBookAction);

    menuManager.appendToGroup("periods.top", periodAllAction); // $NON-NLS-1$
    if (periodActions != null) {
      for (int i = 0; i < periodActions.length; i++) {
        menuManager.appendToGroup("periods", periodActions[i]);
      }
    }

    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    toolBarManager.add(new Separator("additions")); // $NON-NLS-1$
    toolBarManager.add(updateAction);

    TimeSpan periodTimeSpan = TimeSpan.fromString(dialogSettings.get(K_PERIOD));
    TimeSpan resolutionTimeSpan = TimeSpan.fromString(dialogSettings.get(K_RESOLUTION));
    setPeriodActionSelection(periodTimeSpan, resolutionTimeSpan);

    actionBars.setGlobalActionHandler(cutAction.getId(), cutAction);
    actionBars.setGlobalActionHandler(copyAction.getId(), copyAction);
    actionBars.setGlobalActionHandler(pasteAction.getId(), pasteAction);
    actionBars.setGlobalActionHandler(deleteAction.getId(), deleteAction);

    actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), printAction);

    ToolAction toolAction =
        new ToolAction(
            Messages.ChartViewPart_LineAction, this, "org.eclipsetrader.ui.charts.tools.line");
    actionBars.setGlobalActionHandler(toolAction.getId(), toolAction);
    toolAction =
        new ToolAction(
            Messages.ChartViewPart_FiboLineAction,
            this,
            "org.eclipsetrader.ui.charts.tools.fiboline");
    actionBars.setGlobalActionHandler(toolAction.getId(), toolAction);
    toolAction =
        new ToolAction(
            Messages.ChartViewPart_FanLineAction,
            this,
            "org.eclipsetrader.ui.charts.tools.fanline");
    actionBars.setGlobalActionHandler(toolAction.getId(), toolAction);
    toolAction =
        new ToolAction(
            Messages.ChartViewPart_FiboArcAction,
            this,
            "org.eclipsetrader.ui.charts.tools.fiboarc");
    actionBars.setGlobalActionHandler(toolAction.getId(), toolAction);

    actionBars.setGlobalActionHandler(zoomInAction.getActionDefinitionId(), zoomInAction);
    actionBars.setGlobalActionHandler(zoomOutAction.getActionDefinitionId(), zoomOutAction);
    actionBars.setGlobalActionHandler(zoomResetAction.getActionDefinitionId(), zoomResetAction);
    actionBars.setGlobalActionHandler(propertiesAction.getId(), propertiesAction);
    actionBars.updateActionBars();
  }
Ejemplo n.º 19
0
 @Override
 public void init(IViewSite site, IMemento memento) throws PartInitException {
   super.init(site);
   mViewState = memento;
 }
Ejemplo n.º 20
0
 @Override
 public void init(IViewSite site) throws PartInitException {
   OcamlPlugin.setLastFocusedToplevelInstance(this);
   super.init(site);
 }
Ejemplo n.º 21
0
 public void init(IViewSite site) throws PartInitException {
   super.init(site);
   String secId = site.getSecondaryId();
   serverId = CastUtil.cint(secId);
 }