Package org.rssowl.core.util

Examples of org.rssowl.core.util.LongOperationMonitor


  /*
   * @see org.rssowl.core.model.dao.IPersistService#recreateSchema()
   */
  public void recreateSchema() throws PersistenceException {
    DBManager.getDefault().dropDatabase();
    DBManager.getDefault().createDatabase(new LongOperationMonitor(new NullProgressMonitor()) {
      @Override
      public void beginLongOperation() {
        //Do nothing
      }
    });
View Full Code Here


    dialog.setOpenOnRun(false);

    /* Runnable to start core */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
          @Override
          public void beginLongOperation() {
            Display.getDefault().syncExec(new Runnable() {
              public void run() {
                dialog.open();
View Full Code Here

    dialog.setOpenOnRun(false);

    /* Runnable to start core */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
          @Override
          public void beginLongOperation() {
            Display.getDefault().syncExec(new Runnable() {
              public void run() {
                dialog.open();
View Full Code Here

    dialog.setOpenOnRun(false);

    /* Runnable to start core */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
          private boolean updateUi = true;

          @Override
          public void beginLongOperation(boolean isCancelable) {
            if (!isLongOperationRunning()) {
View Full Code Here

  /*
   * @see org.rssowl.core.model.dao.IPersistService#recreateSchema()
   */
  public void recreateSchema() throws PersistenceException {
    DBManager.getDefault().dropDatabase();
    DBManager.getDefault().createDatabase(new LongOperationMonitor(new NullProgressMonitor()) {
      @Override
      public void beginLongOperation(boolean isCancelable) {
      //Do nothing
      }
    });
View Full Code Here

    /* Communicate shutdown to listeners (mandatory before reopening for restore) */
    DBManager.getDefault().shutdown();

    /* Open new empty DB for restore */
    if (!needsEmergencyStartup)
      DBManager.getDefault().startup(new LongOperationMonitor(new NullProgressMonitor()) {}, true, true);

    /* Otherwise if startup is needed, startup with empty DB */
    else
      InternalOwl.getDefault().startup(new LongOperationMonitor(new NullProgressMonitor()) {}, true, true);

    /* Reindex on next startup */
    InternalOwl.getDefault().getPersistenceService().getModelSearch().reIndexOnNextStartup();

    Activator.safeLogInfo(needsEmergencyStartup ? "End: Recreate Profile with OPML Import" : "End: Start Over with Fresh Profile"); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

   *
   * @throws PersistenceException
   */
  public void recreateSchemaForTests() throws PersistenceException {
    DBManager.getDefault().dropDatabaseForTests();
    DBManager.getDefault().startup(new LongOperationMonitor(new NullProgressMonitor()) {}, true, false);

    getModelSearch().clearIndex();
  }
View Full Code Here

    dialog.setOpenOnRun(false);

    /* Runnable to start core */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
          private boolean updateUi = true;

          @Override
          public void beginLongOperation(boolean isCancelable) {
            if (!isLongOperationRunning()) {
View Full Code Here

    assertNotNull(folder.toReference().resolve());
    assertNotNull(bookmark.toReference().resolve());

    InternalOwl.getDefault().recreateProfile(false); //Creates a new, empty rssowl.db.restore
    assertTrue(new File(DBManager.getDBRestoreFilePath()).exists());
    InternalOwl.getDefault().startup(new LongOperationMonitor(new NullProgressMonitor()) {}, false, false); //Normal startup will pickup rssowl.db.restore
    assertFalse(new File(DBManager.getDBRestoreFilePath()).exists());

    assertNull(feed.toReference().resolve());
    assertNull(news.toReference().resolve());
    assertNull(folder.toReference().resolve());
View Full Code Here

    CoreUtils.copy(DBManagerTest.class.getResourceAsStream("/data/rssowl.db"), new FileOutputStream(tmpFile));
    InternalOwl.getDefault().restoreProfile(tmpFile);
    assertTrue(new File(DBManager.getDBRestoreFilePath()).exists());
    if (markerExists)
      assertFalse(marker.exists());
    InternalOwl.getDefault().startup(new LongOperationMonitor(new NullProgressMonitor()) {}, true, false);
    assertFalse(new File(DBManager.getDBRestoreFilePath()).exists());

    assertTrue(DynamicDAO.loadAll(INews.class).isEmpty());
    assertTrue(DynamicDAO.loadAll(IBookMark.class).size() > 100);
    assertTrue(DynamicDAO.loadAll(IFolder.class).size() > 20);
View Full Code Here

TOP

Related Classes of org.rssowl.core.util.LongOperationMonitor

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.