From 133313358b0f9d0af160a23bf1eeb125058ab6c9 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Fri, 2 Nov 2007 15:10:27 +0000 Subject: [PATCH] [208572] merge of file extension property descriptor to open rse --- .../ui/view/SystemViewRemoteFileAdapter.java | 24 +++++++++++++++++-- .../internal/ui/view/SystemViewResources.java | 3 +++ .../ui/view/SystemViewResources.properties | 3 ++- .../rse/ui/view/ISystemPropertyConstants.java | 1 + 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java index 0c635359add..4ea3a678f8f 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java @@ -857,7 +857,7 @@ public class SystemViewRemoteFileAdapter int nbrOfArchiveProperties = 2; int nbrOfVirtualProperties = 4; - int nbrOfProperties = 4; + int nbrOfProperties = 5; if (isVirtual) nbrOfProperties += nbrOfVirtualProperties; else if (isArchive) nbrOfProperties += nbrOfArchiveProperties; @@ -891,6 +891,11 @@ public class SystemViewRemoteFileAdapter else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, SystemViewResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL, SystemViewResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, SystemViewResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL, SystemViewResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); + // file extension + if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + if (isVirtual) { @@ -955,7 +960,7 @@ public class SystemViewRemoteFileAdapter { int nbrOfArchiveProperties = 2; int nbrOfVirtualProperties = 4; - int nbrOfProperties = 8; + int nbrOfProperties = 9; int nbrOfBriefProperties = 2; if (debug) nbrOfProperties += 7; @@ -1013,6 +1018,12 @@ public class SystemViewRemoteFileAdapter else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_HIDDEN, SystemViewResources.RESID_PROPERTY_FILE_HIDDEN_LABEL, SystemViewResources.RESID_PROPERTY_FILE_HIDDEN_TOOLTIP); else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_HIDDEN, SystemViewResources.RESID_PROPERTY_FILE_HIDDEN_LABEL, SystemViewResources.RESID_PROPERTY_FILE_HIDDEN_TOOLTIP); + // file extension + if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, SystemViewResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); + + if (debug) { propertyDescriptorArray[++idx] = createSimplePropertyDescriptor("DEBUG_PARENTREMOTEFILE"); //$NON-NLS-1$ @@ -1223,6 +1234,15 @@ public class SystemViewRemoteFileAdapter { return file.getCanonicalPath(); } + else if (name.equals(ISystemPropertyConstants.P_FILE_EXTENSION)) + { + if(!file.isDirectory()) { + String ext = file.getExtension(); + return ext == null?"":ext; + } + else + return ""; + } else if (name.equals(ISystemPropertyConstants.P_FILE_CLASSIFICATION)) { return file.getClassification(); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.java index 7e19563c641..0258b21dff0 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.java @@ -168,6 +168,9 @@ public class SystemViewResources extends NLS { public static String RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL; public static String RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP; + public static String RESID_PROPERTY_FILE_EXTENSION_LABEL; + public static String RESID_PROPERTY_FILE_EXTENSION_TOOLTIP; + public static String RESID_PROPERTY_FILE_CLASSIFICATION_LABEL; public static String RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.properties index 62a49ed2818..41c926b068c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.properties +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewResources.properties @@ -134,7 +134,8 @@ RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL=Canonical Path RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP=Canonical path of this file or folder RESID_PROPERTY_FILE_CLASSIFICATION_LABEL=Classification RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP=Classification path of this file - +RESID_PROPERTY_FILE_EXTENSION_LABEL=Extension +RESID_PROPERTY_FILE_EXTENSION_TOOLTIP=Extension of this file #SEARCH RESULT PROPERTIES diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java index 5f86ab2ff12..ebc7233ec3b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java @@ -55,6 +55,7 @@ public interface ISystemPropertyConstants extends IBasicPropertyConstants public static final String P_FILE_PATH = P_PREFIX+"file.path"; //$NON-NLS-1$ public static final String P_FILE_CANONICAL_PATH = P_PREFIX+"file.canonicalpath"; //$NON-NLS-1$ public static final String P_FILE_CLASSIFICATION= P_PREFIX+"file.classification"; //$NON-NLS-1$ + public static final String P_FILE_EXTENSION = P_PREFIX+"file.extension"; public static final String P_FILE_READONLY = P_PREFIX+"file.readonly"; //$NON-NLS-1$ public static final String P_FILE_READABLE = P_PREFIX+"file.readable"; //$NON-NLS-1$ public static final String P_FILE_WRITABLE = P_PREFIX+"file.writable"; //$NON-NLS-1$