Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345384 - [TCF][File system] Provide property pages for remote file system nodes
Summary: [TCF][File system] Provide property pages for remote file system nodes
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Target (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 enhancement (vote)
Target Milestone: 0.4.0   Edit
Assignee: Project Inbox CLA
QA Contact: Uwe Stieber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-11 05:31 EDT by Uwe Stieber CLA
Modified: 2013-06-05 05:54 EDT (History)
3 users (show)

See Also:


Attachments
A proposed patch. (95.95 KB, patch)
2011-06-10 04:05 EDT, William Chen CLA
no flags Details | Diff
The new patch. (30.75 KB, patch)
2011-06-16 06:53 EDT, William Chen CLA
no flags Details | Diff
The new patch with packages refactored. (31.07 KB, patch)
2011-06-17 03:55 EDT, William Chen CLA
no flags Details | Diff
New patch based on the feedbacks. (28.11 KB, patch)
2011-06-27 23:32 EDT, William Chen CLA
no flags Details | Diff
The screenshot of the attributes section for Windows files/folders. (33.32 KB, image/png)
2011-06-27 23:34 EDT, William Chen CLA
no flags Details
The screenshot of attributes section for Unix/Linux files/folders. (27.91 KB, image/png)
2011-06-27 23:35 EDT, William Chen CLA
no flags Details
The patch with a new advanced attributes dialog. (32.76 KB, patch)
2011-06-29 01:14 EDT, William Chen CLA
no flags Details | Diff
The screenshot of the new advanced attributes dialog on Windows. (36.42 KB, image/png)
2011-06-29 01:15 EDT, William Chen CLA
no flags Details
New patch with a licensed image. (35.27 KB, patch)
2011-06-30 03:21 EDT, William Chen CLA
uwe.st: iplog+
william.chen: review?
Details | Diff
The image used in the banner area of the advanced properties dialog. (2.26 KB, image/png)
2011-06-30 03:27 EDT, William Chen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stieber CLA 2011-05-11 05:31:16 EDT
For each visualized remote file system node in either the target explorer tree or the file system tree in the peer details editor, provide Windows Explorer like property pages to visualize the file system node properties. 

The property pages should contain at least:
	- Name and Location
	- Size in human readable form and raw bytes
			Example: "Size: 4,00 KB (4.096 bytes)"
	- File attributes like "read only" and "hidden"
			Difficulty: The remote file system attributes style has to be used. Means if the file is
			               on a remote Unix like file system, the user get the typical "read/write/exec"
			               style attributes for "user/group/others"
	- File creation, modified and access times in long localized style
			Example: "Created: ‎Dienstag, ‎19. ‎Oktober ‎2010, ‏‎19:31:29"
Comment 1 William Chen CLA 2011-06-10 04:05:41 EDT
Created attachment 197755 [details]
A proposed patch.
Comment 2 William Chen CLA 2011-06-10 04:12:01 EDT
Hi Uwe,

I created a patch for this bug. In the patch, I added several common columns like those of Windows Explorer. Please check it out and review it.

The column of "file attribute" in the patch now only shows the attribute using Unix style. More information including the remote OS type is needed to customize the attribute's style. I don't know how to acquire such information from TCF connections yet. 

-William
Comment 3 Uwe Stieber CLA 2011-06-10 07:31:27 EDT
Hi William,

First of all, thanks for the contribution :).

I can see what the patch is aiming for, but this is not what this enhancement is asking for. Adding additional columns to the file system editor page control, is OK, but should be handled in a specific enhancement request. Any additional column besides Name, Date modified, Type and Size should be optional and offered to be added on user choice only.

This enhancement is asking for property page contributions to the standard Eclipse properties dialog for directory or file nodes. The specific workflow to solve is

    - Select a file or directory node in either the Target Explorer view
      or the file system editor page control
    - Right Click -> Properties
    - Open the Eclipse properties dialog on the selection
    - Show the node properties in a corresponding property page

As an example on this, you can select a source file in the package explorer, right click -> properties. Look at the "Resource" properties category. That's what we are looking for here.

Technically:

   1. Unfortunately, the patch is breaking the file system tree content
      contribution to the Target Explorer view (FSTreeLabelProvider changes).
      Make sure that you are aware of all use cases for the modified class.
   2. Avoid refactorings where not needed to achieve the desired functionality
      (FSTreeContentProvider refactorings and TCFChannelCallback introduction).
      Keeping the style of the original implementation helps reviewing
      contributions. For this specific case, please don't introduce the
      callback implementations. If there is a specific reason to refactor
      the content provider to be splitted into the callbacks, I suggest
      to discuss it on a specific bugzilla.
   3. Make sure to create patches always from HEAD (FSTreeLabelProvider
      missed a change).
   4. Assert assumptions using the Assert class. Manipulation and access of
      cached TCF data has to be asserted to happen in the TCF event dispatch
      thread only. Method parameters you expect never to be null, should be
      asserted to detect API violations. 

In general, smaller and very specific patches have a better chance to get committed. In example, the introduction of isFile() and isDirectory() to the FSTreeNode is a appreciated change and helps simplifying the comperator implementations. Opening a specific bugzilla asking for exactly this + attaching the specific patch will lead to a faster commit of the patch.

Formatting:

   1. See org.eclipse.tm.te.docs/CONTRIBUTIONS.txt, 3.a). Some public
      and/or protected methods misses the javadoc header.
   2. Remove the @author and spare lines from the class header
   3. In files you are not the initial creator, add a line in
      the form

      * William Chen (Wind River) - [345384] <bug subject>

- Uwe
Comment 4 William Chen CLA 2011-06-13 02:14:56 EDT
Hi Uwe,

I got what you mean now. I misunderstood your original description. Let me create another fix patch for this bug. 

-William
Comment 5 William Chen CLA 2011-06-16 06:53:22 EDT
Created attachment 198080 [details]
The new patch.

Hi Uwe,

I created a new patch for this bug. Could you please have a review?
If there are any issues, please inform me. Thank you.

-William
Comment 6 William Chen CLA 2011-06-17 03:55:47 EDT
Created attachment 198164 [details]
The new patch with packages refactored.

Hi Uwe,

I refactored the patch to use an internal package name. Please review this one. Thanks a lot!

-William
Comment 7 Uwe Stieber CLA 2011-06-26 07:42:33 EDT
Hi William,

it is getting closer :). Here are my comments.

1. First, enable the file system tree contribution for the Target Explorer tree as well. It's "Target Explorer View Menu -> Customize View... -> Content -> Target File System (TCF)". The "Properties" action is missing in the context menu, double click does work.

2. Use the Eclipse standard command id's for global actions like "Properties". The command id for "Properties" is "org.eclipse.ui.file.properties". See IWorkbenchCommandConstants.FILE_PROPERTIES.

3. Use Eclipse standard labels and mnemonics for global actions like "Properties". The action label (with mnemonic) is "P&roperties". See WorkbenchMessages.Workbench_properties. The same applies to the tooltip.

4. The property page contributions should not use the "os.type" as filter. It will be incorrect as this reflects only the host type and not the remote file system type. I suggest to have a general information page containing the common properties for both windows and linux remote file systems plus an exchangeable section with the proper permissions style. 

Note: If building the agent from recent source code, the Windows version reveals the Windows file system specific attributes as "Win32Attrs" in the custom file system node attributes. This can be used to detect if to show "Windows Style" permissions or "Unix Style" permissions. See SystemFilesViewerFilter for an example usage and IWindowsFileAttributes for the bits.
Comment 8 William Chen CLA 2011-06-27 23:32:44 EDT
Created attachment 198697 [details]
New patch based on the feedbacks.

Hi Uwe,

I revised the patch based on your suggestions.
i.e. 1. The properties dialog for Target Explorer view is now working.
2. Use "org.eclipse.file.properties" as the command id and remove redundant handle declaration.
3. Use standard labels, mnemonics and tool tips.
4. Remove os.type filter. Use a unified properties page to display the properties on both Windows and Unix/Linux.
For the extra section that is used to display attributes, please look at the other two attached screenshots. 
If you have any suggestions, please let me know. Thanks.

-William
Comment 9 William Chen CLA 2011-06-27 23:34:24 EDT
Created attachment 198698 [details]
The screenshot of the attributes section for Windows files/folders.
Comment 10 William Chen CLA 2011-06-27 23:35:35 EDT
Created attachment 198699 [details]
The screenshot of attributes section for Unix/Linux files/folders.
Comment 11 Uwe Stieber CLA 2011-06-28 02:00:53 EDT
Hi William,

almost done. The only remaining complain is about the advanced attributes dialog for Windows. It should not reveal all of the attributes and especially not the reserved ones. If you open a Windows Explorer, select a file, right click, Properties, Advanced ..., the advanced attributes dialog should basically look similar to what you get there. It reveals the archive, the index, the compressed and the encrypted attributes only and nicely user understandable.

Thanks, Uwe :)
Comment 12 William Chen CLA 2011-06-29 01:14:19 EDT
Created attachment 198786 [details]
The patch with a new advanced attributes dialog.

Hi Uwe,

I made a modification based your feedback. The screenshot for the new advanced attributes dialog is also attached here. Please have a review. 

Thanks.

-William
Comment 13 William Chen CLA 2011-06-29 01:15:35 EDT
Created attachment 198787 [details]
The screenshot of the new advanced attributes dialog on Windows.
Comment 14 William Chen CLA 2011-06-30 03:21:32 EDT
Created attachment 198875 [details]
New patch with a licensed image.

Adding missing banner image used in the advanced dialog. Please refer to the attached image and its license description.
Comment 15 William Chen CLA 2011-06-30 03:27:33 EDT
Created attachment 198876 [details]
The image used in the banner area of the advanced properties dialog.

The image used in the banner area of the advanced properties dialog. It is licensed under the EPL.
Comment 16 William Chen CLA 2011-06-30 03:29:25 EDT
I, William Chen, declare that I developed the attached code from scratch, without referencing any 3rd party materials except materials licensed under the EPL. I am authorized by my employer to make this contribution under the EPL.

-William Chen
Comment 17 Uwe Stieber CLA 2011-06-30 04:36:02 EDT
committed patch