Search in sources :

Example 1 with IDiffElement

use of org.eclipse.compare.structuremergeviewer.IDiffElement in project linuxtools by eclipse.

the class PrepareChangeLogAction method extractSynchronizeModelInfo.

private void extractSynchronizeModelInfo(ISynchronizeModelElement d, IPath path, Vector<PatchFile> newList, Vector<PatchFile> removeList, Vector<PatchFile> changeList) {
    // Don't add entries for ChangeLog files though.
    if (d.hasChildren()) {
        IPath newPath = path.append(d.getName());
        for (IDiffElement element : d.getChildren()) {
            if (element instanceof ISynchronizeModelElement)
                extractSynchronizeModelInfo((ISynchronizeModelElement) element, newPath, newList, removeList, changeList);
            else {
                if (!(d.getName().equals("ChangeLog"))) {
                    // $NON-NLS-1$
                    PatchFile p = new PatchFile(d.getResource());
                    int kind = d.getKind() & Differencer.CHANGE_TYPE_MASK;
                    if (kind == Differencer.CHANGE) {
                        changeList.add(p);
                    } else if (kind == Differencer.ADDITION) {
                        p.setNewfile(true);
                        newList.add(p);
                    } else if (kind == Differencer.DELETION) {
                        p.setRemovedFile(true);
                        removeList.add(p);
                    }
                } else {
                    this.changeLogModified = true;
                }
            }
        }
    } else {
        if (!(d.getName().equals("ChangeLog"))) {
            // $NON-NLS-1$
            PatchFile p = new PatchFile(d.getResource());
            int kind = d.getKind() & Differencer.CHANGE_TYPE_MASK;
            if (kind == Differencer.CHANGE) {
                changeList.add(p);
            } else if (kind == Differencer.ADDITION) {
                p.setNewfile(true);
                newList.add(p);
            } else if (kind == Differencer.DELETION) {
                p.setRemovedFile(true);
                removeList.add(p);
            }
        } else {
            this.changeLogModified = true;
        }
    }
}
Also used : IDiffElement(org.eclipse.compare.structuremergeviewer.IDiffElement) IPath(org.eclipse.core.runtime.IPath) ISynchronizeModelElement(org.eclipse.team.ui.synchronize.ISynchronizeModelElement)

Aggregations

IDiffElement (org.eclipse.compare.structuremergeviewer.IDiffElement)1 IPath (org.eclipse.core.runtime.IPath)1 ISynchronizeModelElement (org.eclipse.team.ui.synchronize.ISynchronizeModelElement)1