Search in sources :

Example 1 with SVNTreeConflict

use of org.tigris.subversion.subclipse.core.resources.SVNTreeConflict in project subclipse by subclipse.

the class SVNPropertyPage method addSecondSection.

private void addSecondSection(Composite parent) {
    Composite composite = createDefaultComposite(parent);
    Label label = new Label(composite, SWT.NONE);
    // $NON-NLS-1$
    label.setText(Policy.bind("SVNPropertyPage.status"));
    statusValue = new Text(composite, SWT.READ_ONLY);
    statusValue.setBackground(composite.getBackground());
    label = new Label(composite, SWT.NONE);
    // $NON-NLS-1$
    label.setText(Policy.bind("SVNPropertyPage.propStatus"));
    propertiesValue = new Text(composite, SWT.READ_ONLY);
    propertiesValue.setBackground(composite.getBackground());
    if (urlCopiedFrom != null || status.getMovedFromAbspath() != null) {
        label = new Label(composite, SWT.NONE);
        if (status.getMovedFromAbspath() != null) {
            // $NON-NLS-1$
            label.setText(Policy.bind("SVNPropertyPage.movedFrom"));
        } else {
            // $NON-NLS-1$
            label.setText(Policy.bind("SVNPropertyPage.copiedFrom"));
        }
        copiedFromValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
        copiedFromValue.setBackground(composite.getBackground());
        GridData gd = new GridData();
        gd.widthHint = 500;
        copiedFromValue.setLayoutData(gd);
    }
    if (status.getLastChangedRevision() != null) {
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.changedRevision"));
        lastChangedRevisionValue = new Text(composite, SWT.READ_ONLY);
        lastChangedRevisionValue.setBackground(composite.getBackground());
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.changedDate"));
        lastChangedDateValue = new Text(composite, SWT.READ_ONLY);
        lastChangedDateValue.setBackground(composite.getBackground());
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.changedAuthor"));
        lastCommitAuthorValue = new Text(composite, SWT.READ_ONLY);
        lastCommitAuthorValue.setBackground(composite.getBackground());
    }
    if (lockOwnerText != null) {
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.lockOwner"));
        lockOwner = new Text(composite, SWT.READ_ONLY);
        lockOwner.setBackground(composite.getBackground());
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.lockCreationDate"));
        lockCreationDate = new Text(composite, SWT.READ_ONLY);
        lockCreationDate.setBackground(composite.getBackground());
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.lockComment"));
        lockComment = new Label(composite, SWT.WRAP);
        GridData gd = new GridData();
        gd.widthHint = 500;
        lockComment.setLayoutData(gd);
    }
    if (status.hasTreeConflict()) {
        label = new Label(composite, SWT.NONE);
        // $NON-NLS-1$
        label.setText(Policy.bind("SVNPropertyPage.treeConflict"));
        treeConflict = new Text(composite, SWT.READ_ONLY);
        treeConflict.setBackground(composite.getBackground());
        SVNConflictDescriptor conflictDescriptor = status.getConflictDescriptor();
        if (// $NON-NLS-1$
        conflictDescriptor == null)
            // $NON-NLS-1$
            treeConflict.setText("true");
        else {
            SVNTreeConflict svnTreeConflict = new SVNTreeConflict(status);
            treeConflict.setText(svnTreeConflict.getDescription());
            SVNConflictVersion srcLeftVersion = svnTreeConflict.getConflictDescriptor().getSrcLeftVersion();
            if (srcLeftVersion != null) {
                new Label(composite, SWT.NONE);
                Text srcLeftVersionValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
                GridData gd = new GridData();
                gd.widthHint = 500;
                srcLeftVersionValue.setLayoutData(gd);
                // $NON-NLS-1$
                srcLeftVersionValue.setText("Source  left: " + srcLeftVersion.toString());
                srcLeftVersionValue.setBackground(composite.getBackground());
            }
            SVNConflictVersion srcRightVersion = svnTreeConflict.getConflictDescriptor().getSrcRightVersion();
            if (srcRightVersion != null) {
                new Label(composite, SWT.NONE);
                Text srcRightVersionValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
                GridData gd = new GridData();
                gd.widthHint = 500;
                srcRightVersionValue.setLayoutData(gd);
                srcRightVersionValue.setText(// $NON-NLS-1$
                "Source right: " + srcRightVersion.toString());
                srcRightVersionValue.setBackground(composite.getBackground());
            }
        }
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) SVNConflictVersion(org.tigris.subversion.svnclientadapter.SVNConflictVersion) Text(org.eclipse.swt.widgets.Text) SVNConflictDescriptor(org.tigris.subversion.svnclientadapter.SVNConflictDescriptor) SVNTreeConflict(org.tigris.subversion.subclipse.core.resources.SVNTreeConflict)

Example 2 with SVNTreeConflict

use of org.tigris.subversion.subclipse.core.resources.SVNTreeConflict in project subclipse by subclipse.

the class TreeConflictsView method fillContextMenu.

private void fillContextMenu(IMenuManager manager) {
    if (resource != null) {
        boolean conflictSelected = false;
        boolean enableOpen = false;
        IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
        Iterator iter = selection.iterator();
        while (iter.hasNext()) {
            Object element = iter.next();
            if (element instanceof SVNTreeConflict) {
                conflictSelected = true;
                SVNTreeConflict treeConflict = (SVNTreeConflict) element;
                if (treeConflict.getResource() instanceof IFile && treeConflict.getResource().exists()) {
                    enableOpen = true;
                    break;
                }
            }
        }
        if (enableOpen) {
            manager.add(openAction);
        }
        if (enableOpen && selection.size() == 1) {
            MenuManager submenu = // $NON-NLS-1$
            new MenuManager(Policy.bind("TreeConflictsView.openWith"));
            SVNTreeConflict treeConflict = (SVNTreeConflict) selection.getFirstElement();
            submenu.add(new OpenWithMenu(getSite().getPage(), treeConflict.getResource()));
            manager.add(submenu);
        }
        manager.add(new Separator());
        if (selection.size() == 1) {
            if (conflictSelected) {
                manager.add(new ResolveTreeConflictAction(treeViewer, this));
            }
            PropertyDialogAction propertiesAction = new PropertyDialogAction(new SameShellProvider(Display.getDefault().getActiveShell()), treeViewer);
            manager.add(propertiesAction);
            manager.add(new Separator());
        }
        manager.add(getRefreshAction());
    }
}
Also used : IFile(org.eclipse.core.resources.IFile) SameShellProvider(org.eclipse.jface.window.SameShellProvider) Iterator(java.util.Iterator) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) OpenWithMenu(org.eclipse.ui.actions.OpenWithMenu) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) Separator(org.eclipse.jface.action.Separator) SVNTreeConflict(org.tigris.subversion.subclipse.core.resources.SVNTreeConflict) PropertyDialogAction(org.eclipse.ui.dialogs.PropertyDialogAction)

Example 3 with SVNTreeConflict

use of org.tigris.subversion.subclipse.core.resources.SVNTreeConflict in project subclipse by subclipse.

the class OpenFileInSystemEditorAction method getSelectedResources.

protected List getSelectedResources() {
    ArrayList openableFiles = new ArrayList();
    IStructuredSelection selection = (IStructuredSelection) selectionProvider.getSelection();
    Iterator iter = selection.iterator();
    while (iter.hasNext()) {
        Object element = iter.next();
        if (element instanceof SVNTreeConflict) {
            SVNTreeConflict treeConflict = (SVNTreeConflict) element;
            IResource resource = treeConflict.getResource();
            if (resource instanceof IFile && resource.exists()) {
                openableFiles.add(resource);
            }
        }
    }
    return openableFiles;
}
Also used : IFile(org.eclipse.core.resources.IFile) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IResource(org.eclipse.core.resources.IResource) SVNTreeConflict(org.tigris.subversion.subclipse.core.resources.SVNTreeConflict)

Example 4 with SVNTreeConflict

use of org.tigris.subversion.subclipse.core.resources.SVNTreeConflict in project subclipse by subclipse.

the class ResolveTreeConflictAction method run.

public void run() {
    IStructuredSelection selection = (IStructuredSelection) selectionProvider.getSelection();
    SVNTreeConflict treeConflict = (SVNTreeConflict) selection.getFirstElement();
    ResolveTreeConflictWizard wizard = new ResolveTreeConflictWizard(treeConflict, targetPart);
    WizardDialog dialog = new SizePersistedWizardDialog(Display.getDefault().getActiveShell(), wizard, // $NON-NLS-1$
    "ResolveTreeConflict");
    dialog.open();
}
Also used : SizePersistedWizardDialog(org.tigris.subversion.subclipse.ui.wizards.SizePersistedWizardDialog) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog) SizePersistedWizardDialog(org.tigris.subversion.subclipse.ui.wizards.SizePersistedWizardDialog) SVNTreeConflict(org.tigris.subversion.subclipse.core.resources.SVNTreeConflict)

Aggregations

SVNTreeConflict (org.tigris.subversion.subclipse.core.resources.SVNTreeConflict)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 Iterator (java.util.Iterator)2 IFile (org.eclipse.core.resources.IFile)2 ArrayList (java.util.ArrayList)1 IResource (org.eclipse.core.resources.IResource)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 Separator (org.eclipse.jface.action.Separator)1 SameShellProvider (org.eclipse.jface.window.SameShellProvider)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 GridData (org.eclipse.swt.layout.GridData)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 OpenWithMenu (org.eclipse.ui.actions.OpenWithMenu)1 PropertyDialogAction (org.eclipse.ui.dialogs.PropertyDialogAction)1 SizePersistedWizardDialog (org.tigris.subversion.subclipse.ui.wizards.SizePersistedWizardDialog)1 SVNConflictDescriptor (org.tigris.subversion.svnclientadapter.SVNConflictDescriptor)1 SVNConflictVersion (org.tigris.subversion.svnclientadapter.SVNConflictVersion)1