Search in sources :

Example 1 with FileChangeMessage

use of org.eclipse.ecf.internal.sync.resources.core.FileChangeMessage in project ecf by eclipse.

the class WorkbenchAwareResourcesShare method lock.

protected void lock(IModelChange[] remoteChanges) {
    DocShare docShare = SyncResourcesUI.getDocShare(getContainerID());
    if (docShare != null) {
        List paths = new ArrayList(remoteChanges.length);
        for (int i = 0; i < remoteChanges.length; i++) {
            if (remoteChanges[i] instanceof FileChangeMessage) {
                String path = ((FileChangeMessage) remoteChanges[i]).getPath();
                paths.add(path);
            }
        }
        docShare.lock((String[]) paths.toArray(new String[paths.size()]));
    }
    super.lock(remoteChanges);
}
Also used : DocShare(org.eclipse.ecf.docshare2.DocShare) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) FileChangeMessage(org.eclipse.ecf.internal.sync.resources.core.FileChangeMessage)

Example 2 with FileChangeMessage

use of org.eclipse.ecf.internal.sync.resources.core.FileChangeMessage in project ecf by eclipse.

the class WorkbenchAwareResourcesShare method unlock.

protected void unlock(IModelChange[] remoteChanges) {
    super.unlock(remoteChanges);
    DocShare docShare = SyncResourcesUI.getDocShare(getContainerID());
    if (docShare != null) {
        List paths = new ArrayList(remoteChanges.length);
        for (int i = 0; i < remoteChanges.length; i++) {
            if (remoteChanges[i] instanceof FileChangeMessage) {
                String path = ((FileChangeMessage) remoteChanges[i]).getPath();
                paths.add(path);
            }
        }
        docShare.unlock((String[]) paths.toArray(new String[paths.size()]));
    }
}
Also used : DocShare(org.eclipse.ecf.docshare2.DocShare) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) FileChangeMessage(org.eclipse.ecf.internal.sync.resources.core.FileChangeMessage)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 DocShare (org.eclipse.ecf.docshare2.DocShare)2 FileChangeMessage (org.eclipse.ecf.internal.sync.resources.core.FileChangeMessage)2