Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Curious about the make target


In fact, a public refresh method is enough.
Safe anyway to add an accessory.

	public TreeViewer getTreeViewer { return viewer; }
	public void refresh(){ getTreeViewer().refresh(); }

The class is org.eclipse.cdt.internal.ui.makeview.MakeView

Thank you very much


-----Message d'origine-----
De : Alain Magloire [mailto:alain@xxxxxxx]
Envoye : mercredi 29 janvier 2003 16:26
A : cdt-dev@xxxxxxxxxxx
Objet : Re: [cdt-dev] Curious about the make target

> Hello,
> Trying to add new make target to the "Make Target" view part, and refresh
> the MakeView view, I wrote the following lines:
> 	/*
> 	 * Add it
> 	 */
> MakeUtil.removePersistentTarget(getCProject().getProject(),"MyNewTarget");
> // Remove in case it already exists
> MakeUtil.addPersistentTarget(getCProject().getProject(),"MyNewTarget"); //
> Add it
> 	/*
> 	 * Refresh the MakeView
> 	 */
> 	IWorkbenchPage
> ivePage();
> 	IViewPart makeView=page.findView("org.eclipse.cdt.ui.MakeView");
> 	if((makeView!=null)&&(makeView instanceof MakeView))
> 	{
> 		MakeView v=(MakeView)makeView;
> 		v.viewer.refresh();  // Which works only if the tree viewer
> of the MakeView is public (which is not).
> 	}
> Any better way to do this ?
> If not, wouldn't it be an idea to provide a public method in the MakeView
> allowing to create/remove target (refreshing the view), or simply to set
> TreeViewer with a public access ?

Better to have accessory methods, since I expect the makeview to evolve
depending on the builder.  Accessory methods will isolate you, for example,
if the view is no longer a Tree but move to be a table or something.

Send me a patch or the methods you would like to add.

cdt-dev mailing list

Back to the top