Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264901 - [target] target plaform pref page table & move operation
Summary: [target] target plaform pref page table & move operation
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 266020 (view as bug list)
Depends on:
Blocks: 264903
  Show dependency tree
 
Reported: 2009-02-13 16:15 EST by Darin Wright CLA
Modified: 2009-03-02 10:12 EST (History)
3 users (show)

See Also:


Attachments
Patch with table, styling, icon image and sorting (45.79 KB, patch)
2009-02-23 14:43 EST, Ankur Sharma CLA
no flags Details | Diff
Full Patch (30.17 KB, patch)
2009-02-26 08:44 EST, Ankur Sharma CLA
no flags Details | Diff
Full patch with Del key listner (30.79 KB, patch)
2009-02-26 12:29 EST, Ankur Sharma CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2009-02-13 16:15:37 EST
The new target platform preference page needs the following enhancements:

* The view of target definitions should be a table with 2 columns. The first column should be "Name" (as shown currently), and the second column should be the "Location". Definitions stored in the workspace will show their workspace path in this column. Definitions stored with metadata will leave this column blank.

* The table should allow sorting on either column (by pressing the column header). Sort order should be persisted (as a preference, perhaps), so that the order is consistent when the page is later re-opened.

* An image overlay should be used for definitions stored in the workspace - to visually distinguish them. There is a project overlay available (ask Curtis for this...)

* A "Move..." action shold be added to the buttons on the right that enables when a metadata definition is selected, allowing the definition to be moved to the workspace. A dialog should open to allow the user to specify a file location for the definition in the workspace (there should be a standard dialog for this).

Note that the preference page displays in memory copies of all workspace target definitions. This allows all operations on the page to be canceled. In this spirit, moving a target definition to the workspace is also cancelable (this is just copying a meta target def to ws target def that have different handles - the ITargetPlatformService provdies a copy method).
Comment 1 Darin Wright CLA 2009-02-13 16:16:26 EST
Assigning to Ankur. Please ask questions as needed.
Comment 2 Darin Wright CLA 2009-02-18 10:05:31 EST
The "active" target platform should be displayed in bold (similar to the checked/active API baseline in the "Plug-in Development > API Baselines" preference page).
Comment 3 Ankur Sharma CLA 2009-02-23 08:04:48 EST
I will be assigning the Work In Progress patch little later today. Feel free to commit your changes to TargetPlatformPreferencePage2. I'll merge it in my patch to be in sync.
Comment 4 Ankur Sharma CLA 2009-02-23 14:43:13 EST
Created attachment 126495 [details]
Patch with table, styling, icon image and sorting

Work in Progress.

Please review 
1. the icon images and overlays
2. styling for target location
3. sorting
Comment 5 Curtis Windatt CLA 2009-02-23 15:15:51 EST
(In reply to comment #4)
> Please review
> 1. the icon images and overlays

I can't say they look great.  Maybe for now keep the project overlay for the workspace ones and don't put an overlay on te metadata ones.  Perhaps we'll want to get separate icons in the future.

> 2. styling for target location

The brown colour is looking pretty good.  We may want to improve the project location string later.

The bolding doesn't update when you change the check and hit update.  I was also reminded by Mike today that instead of having check boxes we are supposed to have the current platform be bold and have a button to "Set as platform".  The API Baselines page has the same issue.  However, checkboxes are easy to use and are working well for the moment.  Something to keep in mind.

> 3. sorting

I like it, but that doesn't mean everyone will :)
Comment 6 Curtis Windatt CLA 2009-02-23 15:57:09 EST
Minor detail, please change the double click listener to open the edit wizard instead of changing the check state.
Comment 7 Ankur Sharma CLA 2009-02-24 06:50:40 EST
>The bolding doesn't update when you change the check and hit update.

I couldn't see the "Update" button. I could not reproduce this as the bolding happens as soon checkbox is checked. Can explain it bit more.


> ... instead of having check boxes we are supposed
> to have the current platform be bold and have a button to "Set as platform". 

I am adding this button. We can take out the check box or the button (whichever we decide for) later on

> Move... button

1. I shall reuse NewTargetDefinitiionWizard or shall design a new dialog like it?

2. When the target is moved to workspace, the corresponding local target is deleted? If not, Should we name the button "Copy..." instead?

3. The use case for Move button functionality will be like this?
    User selects a Local Target
    Clicks Move
    New File dialog opens, user provides the target file location
    User clicks Finish
    The new target file is created with all attributes copied from that Local Target
    If User OKays the pref page, the Local Target is deleted, on Cancel, the new target file is deleted.

 
Comment 8 Darin Wright CLA 2009-02-24 10:02:47 EST
(In reply to comment #7)
> I couldn't see the "Update" button

I think Curtis mean the "Apply" button.

> > Move... button
> 1. I shall reuse NewTargetDefinitiionWizard or shall design a new dialog like
> it?

Yes - similar to that wizard without the group at the bottom for initializing contents of the target.

> 2. When the target is moved to workspace, the corresponding local target is
> deleted? If not, Should we name the button "Copy..." instead?

I think we should keep it as "Move..." (we could add a copy or duplicate if people want this in the future). Yes, the local target should be deleted. Note that this only happens once OK is pressed. So the local target would be added to the preference page's "fRemove" list (to properly support cancelation). This means that the wizard will also be creating handles to targets in the workspace, that only get saved when OK is pressed.

This also means we need additional checking to ensure that a user does not move two local targets to the same workspace location.

> 3. The use case for Move button functionality will be like this?
>     User selects a Local Target
>     Clicks Move
>     New File dialog opens, user provides the target file location
>     User clicks Finish
>     The new target file is created with all attributes copied from that Local
> Target
>     If User OKays the pref page, the Local Target is deleted, on Cancel, the
> new target file is deleted.

Yes - except the deletion/creation are delayed until OK is pressed.

Comment 9 Darin Wright CLA 2009-02-24 15:42:47 EST
*** Bug 266020 has been marked as a duplicate of this bug. ***
Comment 10 Ankur Sharma CLA 2009-02-26 08:44:18 EST
Created attachment 126843 [details]
Full Patch

You might want to refine the icon images.
Comment 11 Ankur Sharma CLA 2009-02-26 12:29:40 EST
Created attachment 126871 [details]
Full patch with Del key listner

Also made the sorting case insensitive.
Comment 12 Curtis Windatt CLA 2009-02-26 12:36:08 EST
Darn, I was in the middle of changing some things so it could be applied.  Ankur, are the sorting change and the delete key the only changes?  If so I'll look through the patch to find them and included them.
Comment 13 Ankur Sharma CLA 2009-02-26 12:45:51 EST
yes. that's the only 2 diff between Full Patch and "Full Patch with del key listner"

for case insensitivity one word change here

public int compare(Viewer viewer, Object e1, Object e2) {
	int returnValue = ((TargetDefinition) e1).getName().compareToIgnoreCase((((TargetDefinition) e2).getName()));
	if (direction == SWT.DOWN) {
		returnValue = returnValue * -1;
	}
	return returnValue;
}



And for Del Key


table.addKeyListener(new KeyAdapter() {

	public void keyPressed(KeyEvent e) {
		if (e.character == SWT.DEL) {
			IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
			List selected = selection.toList();
			fRemoved.addAll(selected);
			fTargets.removeAll(selected);
			fTableViewer.refresh();
		}

	}
});
Comment 14 Curtis Windatt CLA 2009-02-27 14:38:17 EST
Fixed in HEAD, I changed a couple things from the patch, and added some bug fixes in (the restore defaults and apply buttons could do some bad things).

Ankur, note that if you create any Images they must be disposed explicitly.  So whenever possible use the PDELabelProvider.get or SharedLabelProvider as then then the image lifecycle is managed for you.

I will file bugs for two outstanding issues.
Comment 15 Curtis Windatt CLA 2009-02-27 14:39:30 EST
Comment on attachment 126871 [details]
Full patch with Del key listner

Added to iplog, keep up the good work Ankur.
Comment 16 Ankur Sharma CLA 2009-02-28 00:21:13 EST
>I will file bugs for two outstanding issues.

Please assign them to me. I'll fix them.

>Added to iplog, keep up the good work Ankur.

Thanks. Quick question - Whats iplog?
Comment 17 Curtis Windatt CLA 2009-03-02 10:12:38 EST
(In reply to comment #16)
> >I will file bugs for two outstanding issues.
> 
> Please assign them to me. I'll fix them.
> 

Bug 266548 has been assigned to you, but you may need to wait for a day, as I'm going to work on the other bug (bug 266546) to integrate it with Darin's latest work.

> >Added to iplog, keep up the good work Ankur.
> 
> Thanks. Quick question - Whats iplog?
> 

It is part of the Eclipse IP Policy, which tracks where contributed code comes from and tries to ensure that we can legally use it.

http://www.eclipse.org/projects/dev_process/project-log.php

As you are not a committer on the Eclipse project, we track your contributions.  For small patches we just mark the iplog flag on the attachment, for larger contributions a Contribution Questionaire (CQ).