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());
}
}
}
}
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());
}
}
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;
}
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();
}
Aggregations