コード例 #1
0
  private static String getLastSyncConnection(IContainer container) {
    if (container == null) {
      return null;
    }
    // only shows the decorator when user chooses to
    // remember the decision
    boolean remember = ResourceSynchronizationUtils.isRememberDecision(container);
    if (!remember) {
      return null;
    }

    String lastConnection = ResourceSynchronizationUtils.getLastSyncConnection(container);
    if (lastConnection == null) {
      return null;
    }

    ISiteConnection[] sites = SiteConnectionUtils.findSitesForSource(container, true);
    String target;
    for (ISiteConnection site : sites) {
      target = site.getDestination().getName();
      if (target.equals(lastConnection)) {
        return target;
      }
    }
    return null;
  }
コード例 #2
0
 @Override
 public int hashCode() {
   if (hashCode == 0) {
     hashCode = 7;
     hashCode = 31 * hashCode + project.hashCode();
     hashCode = 31 * hashCode + siteConnection.hashCode();
   }
   return hashCode;
 }
コード例 #3
0
 @SuppressWarnings("rawtypes")
 public Object getAdapter(Class adapter) {
   if (adapter == IProject.class) {
     return project;
   } else if (adapter == ISiteConnection.class) {
     return siteConnection;
   } else if (adapter == IConnectionPoint.class) {
     return siteConnection.getDestination();
   } else if (adapter == IFileStore.class) {
     IConnectionPoint destination = siteConnection.getDestination();
     try {
       return (destination == null) ? null : destination.getRoot();
     } catch (CoreException e) {
       // falls through on error
     }
   }
   return super.getAdapter(adapter);
 }
コード例 #4
0
 @Override
 public int hashCode() {
   return fSite.hashCode();
 }
コード例 #5
0
 public String getToolTipText() {
   return fSite == null ? "" : fSite.toString(); // $NON-NLS-1$
 }
コード例 #6
0
 public String getName() {
   return fSite == null ? "" : fSite.getName(); // $NON-NLS-1$
 }
コード例 #7
0
 public boolean canDisconnect() {
   IConnectionPoint connectionPoint = siteConnection.getDestination();
   return (connectionPoint == null) ? false : connectionPoint.canDisconnect();
 }