Package net.sourceforge.fullsync

Examples of net.sourceforge.fullsync.Profile


    super.dispose();
  }

  @Override
  public Profile getSelectedProfile() {
    Profile p = null;
    TableItem[] sel = tableProfiles.getSelection();
    if (sel.length > 0) {
      p = (Profile) (sel[0].getData());
    }
    return p;
View Full Code Here


      if (this.profileName == null) {
        return;
      }

      Profile p = profileManager.getProfile(profileName);
      if (p == null) {
        throw new IllegalArgumentException(Messages.getString("ProfileDetails.profile_does_not_exist")); //$NON-NLS-1$
      }

      textProfileName.setText(p.getName());
      textProfileDescription.setText(p.getDescription());

      srcConnectionConfiguration.setConnectionDescription(p.getSource());
      if (null != p.getSource()) {
        srcConnectionConfiguration.setBuffered("syncfiles".equals(p.getSource().getParameter("bufferStrategy"))); //$NON-NLS-1$
      }

      dstConnectionConfiguration.setConnectionDescription(p.getDestination());
      if (null != p.getDestination()) {
        dstConnectionConfiguration.setBuffered("syncfiles".equals(p.getDestination().getParameter("bufferStrategy"))); //$NON-NLS-1$
      }

      if ((p.getSynchronizationType() != null) && (p.getSynchronizationType().length() > 0)) {
        comboType.setText(p.getSynchronizationType());
      }

      buttonScheduling.setData(p.getSchedule());
      buttonEnabled.setSelection(p.isEnabled());

      RuleSetDescriptor ruleSetDescriptor = p.getRuleSet();
      filter = null;

      SimplyfiedRuleSetDescriptor simpleDesc = (SimplyfiedRuleSetDescriptor) ruleSetDescriptor;
      syncSubsButton.setSelection(simpleDesc.isSyncSubDirs());
      FileFilter fileFilter = simpleDesc.getFileFilter();
View Full Code Here

      ExceptionHandler.reportException(e);
      return false;
    }

    if ((profileName == null) || !textProfileName.getText().equals(profileName)) {
      Profile pr = profileManager.getProfile(textProfileName.getText());
      if (pr != null) {
        MessageBox mb = new MessageBox(m_parent.getShell(), SWT.ICON_ERROR);
        mb.setText(Messages.getString("ProfileDetails.Duplicate_Entry")); //$NON-NLS-1$
        mb.setMessage(Messages.getString("ProfileDetails.Profile_already_exists")); //$NON-NLS-1$
        mb.open();
        return false;
      }
    }
    Profile p;
    RuleSetDescriptor ruleSetDescriptor = null;
    ruleSetDescriptor = new SimplyfiedRuleSetDescriptor(syncSubsButton.getSelection(), filter, buttonUseFileFilter.getSelection(),
        getFileFilterTree());

    if (profileName == null) {
      p = new Profile(textProfileName.getText(), src, dst, ruleSetDescriptor);
      p.setSynchronizationType(comboType.getText());
      p.setDescription(textProfileDescription.getText());
      p.setSchedule((Schedule) buttonScheduling.getData());
      p.setEnabled(buttonEnabled.getSelection());
      if (buttonResetError.getSelection()) {
        p.setLastError(0, null);
      }
      profileManager.addProfile(p);
    }
    else {
      p = profileManager.getProfile(profileName);
      p.beginUpdate();
      p.setName(textProfileName.getText());
      p.setDescription(textProfileDescription.getText());
      p.setSynchronizationType(comboType.getText());
      p.setSource(src);
      p.setDestination(dst);
      p.setSchedule((Schedule) buttonScheduling.getData());
      p.setEnabled(buttonEnabled.getSelection());

      p.setRuleSet(ruleSetDescriptor);
      if (buttonResetError.getSelection()) {
        p.setLastError(0, null);
      }
      p.endUpdate();
    }
    profileManager.save();
    return true; //FIXME: return false if failed
  }
View Full Code Here

    return profileManager.isSchedulerEnabled();
  }

  @Override
  public TaskTree executeProfile(String name) throws RemoteException {
    Profile p = profileManager.getProfile(name);
    TaskTree tree = synchronizer.executeProfile(p, false);
    return tree;
  }
View Full Code Here

      }
    }

    // Check for added and modified profiles
    for (Profile profile : profiles) {
      Profile p = profileManager.getProfile(profile.getName());
      if (p == null) {
        profileManager.addProfile(profile);
      }
      else {
        p.setName(profile.getName());
        p.setDescription(profile.getDescription());
        p.setSource(profile.getSource());
        p.setDestination(profile.getDestination());
        p.setSynchronizationType(profile.getSynchronizationType());
        p.setRuleSet(profile.getRuleSet());
        p.setSchedule(profile.getSchedule());
        p.setEnabled(profile.isEnabled());

        profileManager.profileChanged(p);
      }
    }
  }
View Full Code Here

      final Synchronizer sync = new Synchronizer();

      // Apply executing options
      if (line.hasOption("r")) {
        Profile p = profileManager.getProfile(line.getOptionValue("r"));
        TaskTree tree = sync.executeProfile(p, false);
        sync.performActions(tree);
        p.setLastUpdate(new Date());
        profileManager.save();
        return;
      }

      boolean activateRemote = false;
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.Profile

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.