diff options
author | Dani Megert | 2012-09-19 08:37:40 +0000 |
---|---|---|
committer | Dani Megert | 2012-09-19 08:37:40 +0000 |
commit | 99d1066284f94d75c0f6566b198ad86cc72b47cc (patch) | |
tree | 24a26b42360adedd60003e3865e3a4a860708651 | |
parent | a8124db84b5c192d1dfc2b52bcdaa4b9bde5bf4a (diff) | |
download | eclipse.platform.team-99d1066284f94d75c0f6566b198ad86cc72b47cc.tar.gz eclipse.platform.team-99d1066284f94d75c0f6566b198ad86cc72b47cc.tar.xz eclipse.platform.team-99d1066284f94d75c0f6566b198ad86cc72b47cc.zip |
Fixed bug 222090: CVS property page text fields should be copyable
3 files changed, 66 insertions, 60 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java index 539bf1ff1..c7d18d8b6 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; -import com.ibm.icu.text.DateFormat; import java.util.Date; import org.eclipse.core.resources.IFile; @@ -19,7 +18,8 @@ import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.*; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSTag; import org.eclipse.team.internal.ccvs.core.ICVSFile; @@ -28,6 +28,8 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; import org.eclipse.team.internal.ccvs.core.util.Util; import org.eclipse.ui.PlatformUI; +import com.ibm.icu.text.DateFormat; + public class CVSFilePropertiesPage extends CVSPropertiesPage { IFile file; @@ -63,55 +65,36 @@ public class CVSFilePropertiesPage extends CVSPropertiesPage { } else { // Base createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_baseRevision); - createLabel(composite, syncInfo.getRevision()); + createReadOnlyText(composite, syncInfo.getRevision()); Date baseTime = syncInfo.getTimeStamp(); if (baseTime != null) { createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_baseTimestamp); - createLabel(composite, DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(syncInfo.getTimeStamp())); + createReadOnlyText(composite, DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(syncInfo.getTimeStamp())); } // Modified createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_modified); - createLabel(composite, cvsResource.isModified(null) ? CVSUIMessages.yes : CVSUIMessages.no); // + createReadOnlyText(composite, cvsResource.isModified(null) ? CVSUIMessages.yes : CVSUIMessages.no); // } // Keyword Mode createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_keywordMode); - createLabel(composite, syncInfo.getKeywordMode().getLongDisplayText()); + createReadOnlyText(composite, syncInfo.getKeywordMode().getLongDisplayText()); // Tag createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_tag); CVSTag tag = Util.getAccurateFileTag(cvsResource); - createLabel(composite, getTagLabel(tag)); + createReadOnlyText(composite, getTagLabel(tag)); } catch (TeamException e) { // Display error text createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_error); - createLabel(composite, ""); //$NON-NLS-1$ + createReadOnlyText(composite, ""); //$NON-NLS-1$ } - PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.FILE_PROPERTY_PAGE); - Dialog.applyDialogFont(parent); + PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.FILE_PROPERTY_PAGE); + Dialog.applyDialogFont(parent); return composite; } - /** - * Utility method that creates a label instance - * and sets the default layout data. - * - * @param parent the parent for the new label - * @param text the text for the new label - * @return the new label - */ - protected Label createLabel(Composite parent, String text, int span) { - Label label = new Label(parent, SWT.LEFT); - label.setText(text); - GridData data = new GridData(); - data.horizontalSpan = span; - data.horizontalAlignment = GridData.FILL; - label.setLayoutData(data); - return label; - } - protected Label createLabel(Composite parent, String text) { - return createLabel(parent, text, 1); - } + /** * Initializes the page */ diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFolderPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFolderPropertiesPage.java index 7cb05814e..fdd9aab1a 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFolderPropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFolderPropertiesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,8 +33,10 @@ import org.eclipse.ui.PlatformUI; public class CVSFolderPropertiesPage extends CVSPropertiesPage { IFolder folder; - private Label root; - private Label repository; + + private Text root; + + private Text repository; /** * @see PreferencePage#createContents(Composite) @@ -63,9 +65,9 @@ public class CVSFolderPropertiesPage extends CVSPropertiesPage { } else { FolderSyncInfo syncInfo = cvsResource.getFolderSyncInfo(); createLabel(composite, CVSUIMessages.CVSFolderPropertiesPage_root); - root = createLabel(composite, syncInfo.getRoot()); + root= createReadOnlyText(composite, syncInfo.getRoot()); createLabel(composite, CVSUIMessages.CVSFolderPropertiesPage_repository); - repository = createLabel(composite, syncInfo.getRepository()); + repository= createReadOnlyText(composite, syncInfo.getRepository()); // Tag createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_tag); @@ -75,12 +77,12 @@ public class CVSFolderPropertiesPage extends CVSPropertiesPage { tag = Util.getAccurateFolderTag(folder, tag); } - createLabel(composite, getTagLabel(tag)); + createReadOnlyText(composite, getTagLabel(tag)); // Static-ness if (syncInfo.getIsStatic()) { createLabel(composite, CVSUIMessages.CVSFolderPropertiesPage_static); - createLabel(composite, syncInfo.getIsStatic() ? CVSUIMessages.yes : CVSUIMessages.no); // + createReadOnlyText(composite, syncInfo.getIsStatic() ? CVSUIMessages.yes : CVSUIMessages.no); // } createLabel(composite, "", 2); // spacer //$NON-NLS-1$ @@ -113,27 +115,6 @@ public class CVSFolderPropertiesPage extends CVSPropertiesPage { } /** - * Utility method that creates a label instance - * and sets the default layout data. - * - * @param parent the parent for the new label - * @param text the text for the new label - * @return the new label - */ - protected Label createLabel(Composite parent, String text, int span) { - Label label = new Label(parent, SWT.LEFT); - label.setText(text); - GridData data = new GridData(); - data.horizontalSpan = span; - data.horizontalAlignment = GridData.FILL; - label.setLayoutData(data); - return label; - } - - protected Label createLabel(Composite parent, String text) { - return createLabel(parent, text, 1); - } - /** * Initializes the page */ private void initialize() { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java index ccf4ba227..42324c9d0 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,9 @@ package org.eclipse.team.internal.ccvs.ui; import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.*; import org.eclipse.team.internal.ccvs.core.CVSTag; import org.eclipse.ui.dialogs.PropertyPage; @@ -42,4 +45,43 @@ public abstract class CVSPropertiesPage extends PropertyPage { return tag.getName(); } } + + /** + * Utility method that creates a label instance and sets the default layout data. + * + * @param parent the parent for the new label + * @param text the text for the new label + * @return the new label + */ + protected Label createLabel(Composite parent, String text, int span) { + Label label = new Label(parent, SWT.LEFT); + label.setText(text); + GridData data = new GridData(); + data.horizontalSpan = span; + data.horizontalAlignment = GridData.FILL; + label.setLayoutData(data); + return label; + } + + protected Label createLabel(Composite parent, String text) { + return createLabel(parent, text, 1); + } + + /** + * Utility method that creates a read-only text field and sets the default layout data. + * + * @param parent the parent for the new text field + * @param text the text + * @return the new read-only text field + * @since 4.3 + */ + protected Text createReadOnlyText(Composite parent, String text) { + Text textField = new Text(parent, SWT.LEFT | SWT.READ_ONLY); + textField.setText(text); + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + textField.setLayoutData(data); + return textField; + } + } |