Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ICDescriptor.saveProjectData() - what should I use instead of this deprecated class and method ?

Hi Gidi,

I don't know if I understand your usecase properly, but the pseudo
code for the read/edit/write if you want to edit all configurations
is:

// get project description
des = CCorePlugin.getDefault().getProjectDescription(...)
// get all configurations
cfgs = des.getConfigurations()
// iterate all configs and use get/set config to make your changes
foreach cfg in cfgs:
   use cfg.get and cfg.set
// save changes
CCorePlugin.getDefault().setProjectDescription(...)

So the closest equivalent of save is
CCorePlugin.getDefault().setProjectDescription. The edits you make
(inside the foreach loop above) is the set methods of
ICStorageElement.

> CConfigBasedDescriptor.saveProjectData is using internal API
This eventually calls
CConfigBasedDescriptor.SerializingJob.serialize() which calls
CProjectDescriptionManager.getInstance().setProjectDescription() - the
same method called by the public API
CCorePlugin.getDefault().setProjectDescription().

HTH.
Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

On Sat, 28 Dec 2019 at 07:40, Gidi Gal1 <GGal1@xxxxxxxxxx> wrote:
>
> Hi Jonah,
>
> Thanks for your reply. There are two methods in ICDescriptor that I need: getProjectStorageElement and saveProjectData.
> For getProjectStorageElement  I found ICSettingsStorage.getStorage, which is accessible from ICConfigurationDescription. I hope this is the right replacement.
>
> However, I cannot find the replacement for saveProjectData. I tried debugging the ICDescriptor.saveProjectData code, hoping that it will lead me to a public API that is not deprecated. Sadly, the code in CConfigBasedDescriptor.saveProjectData is using internal API.
>
> Thanks,
> Gidi
>
>
>
> From:        Jonah Graham <jonah@xxxxxxxxxxxxxxxx>
> To:        "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
> Date:        12/27/2019 07:40 PM
> Subject:        [EXTERNAL] Re: [cdt-dev] ICDescriptor.saveProjectData() - what should I use instead of this deprecated class and method ?
> Sent by:        cdt-dev-bounces@xxxxxxxxxxx
> ________________________________
>
>
>
> Hi Gidi,
>
> Its not (just) saveProjectData that is deprecated, but rather all of
> ICDescriptor. See javadocs for ICDescriptor, which I include here for
> your convenience:
>
> org.eclipse.cdt.core.ICDescriptor
>
>
> @Deprecated
>
> Deprecated. as this API is not configuration aware. Replaced by
> ICConfigurationDescription which can be fetched with
> ICProjectDescription.getConfigurations()
>
> @noreferenceThis interface is not intended to be referenced by clients.
>
>
> ~~~
> Jonah Graham
> Kichwa Coders
> www.kichwacoders.com
>
> On Fri, 27 Dec 2019 at 08:58, Gidi Gal1 <GGal1@xxxxxxxxxx> wrote:
> >
> > Hello,
> >
> > I am currently working on upgrading an old Eclipse plugin. It uses ICDescriptor.saveProjectData(), which is deprecated.
> > What method replaces this method ?
> >
> > Thanks,
> > Gidi
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> > https://www.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/cdt-dev
>
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/cdt-dev


Back to the top