use of org.tigris.subversion.svnclientadapter.ISVNProperty in project subclipse by subclipse.
the class EditPropertyConflictsWizardPropertyPage method createControl.
public void createControl(Composite parent) {
EditPropertyConflictsWizard wizard = (EditPropertyConflictsWizard) getWizard();
ISVNLocalResource svnResource = wizard.getSvnResource();
try {
ISVNProperty[] properties = svnResource.getSvnProperties();
for (int i = 0; i < properties.length; i++) {
if (properties[i].getName().equals(propertyConflict.getPropertyName())) {
propertyValue = properties[i].getValue();
break;
}
}
} catch (SVNException e) {
}
ISVNProperty[] remoteProperties = wizard.getRemoteProperties();
for (int i = 0; i < remoteProperties.length; i++) {
if (remoteProperties[i].getName().equals(propertyConflict.getPropertyName())) {
remoteProperty = remoteProperties[i];
break;
}
}
Composite outerContainer = new Composite(parent, SWT.NONE);
outerContainer.setLayout(new GridLayout());
outerContainer.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
myValueButton = new Button(outerContainer, SWT.RADIO);
myValueButton.setText(Messages.EditPropertyConflictsWizardPropertyPage_0);
myValueText = new Text(outerContainer, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
GridData data = new GridData(GridData.FILL_BOTH);
data.heightHint = 100;
data.widthHint = 400;
data.horizontalIndent = 30;
data.grabExcessHorizontalSpace = true;
myValueText.setLayoutData(data);
if (propertyValue != null) {
myValueText.setText(propertyValue);
}
incomingValueButton = new Button(outerContainer, SWT.RADIO);
incomingValueButton.setText(Messages.EditPropertyConflictsWizardPropertyPage_1);
incomingValueText = new Text(outerContainer, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
data = new GridData(GridData.FILL_BOTH);
data.horizontalSpan = 2;
data.heightHint = 100;
data.widthHint = 400;
data.horizontalIndent = 30;
data.grabExcessHorizontalSpace = true;
incomingValueText.setLayoutData(data);
if (remoteProperty != null) {
incomingValueText.setText(remoteProperty.getValue());
}
myValueButton.setSelection(true);
SelectionListener selectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
if (incomingValueButton.getSelection()) {
propertyValue = incomingValueText.getText();
} else {
propertyValue = myValueText.getText();
}
}
};
myValueButton.addSelectionListener(selectionListener);
incomingValueButton.addSelectionListener(selectionListener);
ModifyListener modifyListener = new ModifyListener() {
public void modifyText(ModifyEvent evt) {
if (evt.getSource() == myValueText && myValueButton.getSelection()) {
propertyValue = myValueText.getText();
}
if (evt.getSource() == incomingValueText && incomingValueButton.getSelection()) {
propertyValue = incomingValueText.getText();
}
}
};
myValueText.addModifyListener(modifyListener);
incomingValueText.addModifyListener(modifyListener);
setControl(outerContainer);
setMessage(Messages.EditPropertyConflictsWizardPropertyPage_2 + propertyConflict.getPropertyName() + Messages.EditPropertyConflictsWizardPropertyPage_3);
}
use of org.tigris.subversion.svnclientadapter.ISVNProperty in project subclipse by subclipse.
the class PropertyCompareLocalResourceNode method getChildren.
public Object[] getChildren() {
if (children == null) {
List<Object> childList = new ArrayList<Object>();
for (ISVNProperty property : properties) {
if (property.getFile().getAbsolutePath().equals(resource.getLocation().toOSString())) {
childList.add(new PropertyComparePropertyNode(property));
}
}
if (recursive && resource instanceof IContainer) {
try {
IResource[] childResources = ((IContainer) resource).members();
for (IResource childResource : childResources) {
PropertyCompareLocalResourceNode childNode = new PropertyCompareLocalResourceNode(childResource, true, properties);
childList.add(childNode);
}
} catch (CoreException e) {
SVNUIPlugin.log(e);
}
}
children = new Object[childList.size()];
childList.toArray(children);
}
return children;
}
use of org.tigris.subversion.svnclientadapter.ISVNProperty in project subclipse by subclipse.
the class SVNPropertyAction method getSelectedSvnProperties.
/**
* Returns the selected svn properties
*/
protected ISVNProperty[] getSelectedSvnProperties() {
ArrayList resources = null;
if (!selection.isEmpty()) {
resources = new ArrayList();
Iterator elements = ((IStructuredSelection) selection).iterator();
while (elements.hasNext()) {
Object next = elements.next();
if (next instanceof ISVNProperty) {
resources.add(next);
continue;
}
if (next instanceof IAdaptable) {
IAdaptable a = (IAdaptable) next;
Object adapter = a.getAdapter(ISVNProperty.class);
if (adapter instanceof ISVNProperty) {
resources.add(adapter);
continue;
}
}
}
}
if (resources != null && !resources.isEmpty()) {
ISVNProperty[] result = new ISVNProperty[resources.size()];
resources.toArray(result);
return result;
}
return new ISVNProperty[0];
}
use of org.tigris.subversion.svnclientadapter.ISVNProperty in project subclipse by subclipse.
the class ConfigureTagsAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
IResource[] resources = getSelectedResources();
ISVNLocalResource[] svnResources = new ISVNLocalResource[resources.length];
ISVNProperty lastProperty = null;
for (int i = 0; i < resources.length; i++) {
svnResources[i] = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
try {
// $NON-NLS-1$
ISVNProperty property = svnResources[i].getSvnProperty("subclipse:tags");
if (i > 0 && !propertiesEqual(property, lastProperty)) {
MessageDialog.openError(getShell(), Messages.ConfigureTagsAction_1, Messages.ConfigureTagsAction_2);
return;
}
lastProperty = property;
} catch (SVNException e) {
}
}
SvnWizardConfigureTagsPage configureTagsPage = new SvnWizardConfigureTagsPage(svnResources);
SvnWizard wizard = new SvnWizard(configureTagsPage);
SvnWizardDialog dialog = new SvnWizardDialog(getShell(), wizard);
wizard.setParentDialog(dialog);
dialog.open();
}
use of org.tigris.subversion.svnclientadapter.ISVNProperty in project subclipse by subclipse.
the class LocalResource method getSvnProperty.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalResource#getSvnProperty(java.lang.String)
*/
public ISVNProperty getSvnProperty(String name) throws SVNException {
ISVNClientAdapter svnClient = null;
try {
svnClient = SVNProviderPlugin.getPlugin().getSVNClient();
SVNProviderPlugin.disableConsoleLogging();
ISVNProperty prop = svnClient.propertyGet(getFile(), name);
return prop;
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
SVNProviderPlugin.enableConsoleLogging();
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClient);
}
}
Aggregations