Bug 256182 - A new ChangeLog should only ask about locations within the current project
Summary: A new ChangeLog should only ask about locations within the current project
Status: RESOLVED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: ChangeLog (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.5   Edit
Assignee: Phil Muldoon CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 179552
  Show dependency tree
 
Reported: 2008-11-21 17:46 EST by Jeff Johnston CLA
Modified: 2011-06-06 15:27 EDT (History)
1 user (show)

See Also:


Attachments
Patch for only displaying project of selected file in selection dialog (1.90 KB, patch)
2009-11-09 14:13 EST, Roland Grunberg CLA
no flags Details | Diff
changelog patch using the new Selection Dialog (946 bytes, patch)
2009-11-09 17:28 EST, Roland Grunberg CLA
no flags Details | Diff
ChangeLogSelectionRootContainer (7.99 KB, text/plain)
2009-11-09 17:30 EST, Roland Grunberg CLA
no flags Details
ChangeLogSelectionGroup (11.81 KB, text/plain)
2009-11-09 17:31 EST, Roland Grunberg CLA
no flags Details
ChangeLogSelectionDialog (6.46 KB, text/plain)
2009-11-09 17:31 EST, Roland Grunberg CLA
no flags Details
ChangeLogContainerContentProvider (4.19 KB, text/plain)
2009-11-10 10:30 EST, Roland Grunberg CLA
no flags Details
ChangeLogContainerSelectionDialog (6.64 KB, text/plain)
2009-11-10 10:30 EST, Roland Grunberg CLA
no flags Details
ChangeLogContainerSelectionGroup (11.81 KB, text/plain)
2009-11-10 10:31 EST, Roland Grunberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Johnston CLA 2008-11-21 17:46:16 EST
Currently, if no ChangeLog exists and Ctrl+Alt+C is pressed, a dialog opens which asks for location of the ChangeLog.  This dialog offers multiple projects as the starting point.  This should restrict the choice to the current project only.  In addition, if the current project has no subfolders to choose from, then the ChangeLog should simply default to the top level directory of the project.
Comment 1 Andrew Overholt CLA 2009-01-13 16:15:54 EST
Let's discuss this and implement a solution for 0.2.
Comment 2 Andrew Overholt CLA 2009-04-13 14:12:31 EDT
Unsetting milestone until we have a concrete plan.
Comment 3 Roland Grunberg CLA 2009-11-09 14:13:25 EST
Created attachment 151723 [details]
Patch for only displaying project of selected file in selection dialog
Comment 4 Roland Grunberg CLA 2009-11-09 14:14:22 EST
The ContainerSelectionDialog  does not display hidden projects, so the current proposed patch temporarily hides all projects in the workspace except for the one that contains the file from which 'ctrl + alt +c' was initiated. This causes only one project (and all of its contained folders) to be displayed. After the user completes their selection, all projects are un-hidden again.
Comment 5 Jeff Johnston CLA 2009-11-09 14:44:14 EST
(In reply to comment #4)
> The ContainerSelectionDialog  does not display hidden projects, so the current
> proposed patch temporarily hides all projects in the workspace except for the
> one that contains the file from which 'ctrl + alt +c' was initiated. This
> causes only one project (and all of its contained folders) to be displayed.
> After the user completes their selection, all projects are un-hidden again.

This seems dangerous; if an exception or interruption occurs, the projects will be left hidden.  Have you tried just passing to the ContainerSelectionDialog, the project as the root container or if necessary, creating a temporary container which just contains the given project inside of it?
Comment 6 Roland Grunberg CLA 2009-11-09 17:28:45 EST
Created attachment 151749 [details]
changelog patch using the new Selection Dialog

New proposed patch. A new Selection Dialog is created based on the ContainerSelectionDialog.
Comment 7 Roland Grunberg CLA 2009-11-09 17:30:15 EST
Created attachment 151750 [details]
ChangeLogSelectionRootContainer
Comment 8 Roland Grunberg CLA 2009-11-09 17:31:05 EST
Created attachment 151751 [details]
ChangeLogSelectionGroup
Comment 9 Roland Grunberg CLA 2009-11-09 17:31:41 EST
Created attachment 151752 [details]
ChangeLogSelectionDialog
Comment 10 Jeff Johnston CLA 2009-11-09 17:54:17 EST
Looks much better.  You need to remove the internal class references 

import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.ui.internal.ide.misc.ContainerContentProvider;

and

import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.ui.internal.ide.IIDEHelpContextIds;

For IDEWorkbenchMessages, use a local message provider and copy over the few messages referred to.

For ContainerContentProvider, copy the class over as it has no internal references within it.

For the IIDEHelpContextIds, just form the id yourself using the same prefix and String used in IIDEHelpContextIds for the one context id used.

Also please fix up the header comments in the last two files to have Red Hat Inc. as contributors, followed by your comment about modifying the file for use with ChangeLog.  e.g.

/*******************************************************************************
 * Copyright (c) 2000, 2008, 2009 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
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Igor Fedorenko <igorfie@yahoo.com> - 
 *     		Fix for Bug 136921 [IDE] New File dialog locks for 20 seconds
 *     Red Hat Inc. - modified this file to work with ChangeLog Plugin
 *******************************************************************************/
Comment 11 Roland Grunberg CLA 2009-11-10 10:30:07 EST
Created attachment 151827 [details]
ChangeLogContainerContentProvider
Comment 12 Roland Grunberg CLA 2009-11-10 10:30:44 EST
Created attachment 151828 [details]
ChangeLogContainerSelectionDialog
Comment 13 Roland Grunberg CLA 2009-11-10 10:31:25 EST
Created attachment 151829 [details]
ChangeLogContainerSelectionGroup
Comment 14 Andrew Overholt CLA 2009-11-10 11:01:29 EST
Is there a way we can do this without carrying modified version of platform classes?
Comment 15 Jeff Johnston CLA 2009-11-10 14:11:44 EST
(In reply to comment #14)
> Is there a way we can do this without carrying modified version of platform
> classes?

These are just UI elements that aren't quite doing what we want and aren't extensible to do what we want.  To my knowledge, there is nothing existing out there that does exactly what we want.

The Container dialog in question is insisting on going up the Container parent path and thereby showing the entire workspace when all we want to show is one project's directory structure.  We would normally write such custom UI elements from scratch but it buys us nothing over copying over the existing classes which are close and making minor modifications to fit our situation.  

We can alternatively campaign to have ContainerSelectionDialog modified but that will likely take a while.
Comment 16 Andrew Overholt CLA 2009-11-10 15:04:41 EST
(In reply to comment #15)
> (In reply to comment #14)
> > Is there a way we can do this without carrying modified version of platform
> > classes?
> 
> These are just UI elements that aren't quite doing what we want and aren't
> extensible to do what we want.

Thanks for the clarifications.  I was under the impression they were "deeper" elements than this and that the modifications were more severe.
Comment 17 Roland Grunberg CLA 2009-11-10 17:07:06 EST
Revision 23726.
Comment 18 Roland Grunberg CLA 2009-11-12 15:54:13 EST
This has been fixed.
Comment 19 Andrew Overholt CLA 2011-06-06 15:27:48 EDT
Comment on attachment 151749 [details]
changelog patch using the new Selection Dialog

Marking patch obsolete since it was done by a committer.