Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Allowing extensions to AbstractConfigurationBlockPropertyAndPreferencePage perform... methods

Hi Gabriel,

You should override the following method in your *Block class:
protected IPreferenceChangeRebuildPrompt getPreferenceChangeRebuildPrompt(boolean workspaceSettings, Collection changedOptions) {
	return null;
}

- workspaceSettings - true for workspace preferences, false for project
- changedOptions contains keys of the changed preferences

If you want rebuild you should return object with texts to be used in dialog, example taken from AbstractTodoTaskOptionsBlock:

return PreferenceChangeRebuildPrompt.create(
	workspaceSettings,
	PreferencesMessages.TodoTaskConfigurationBlock_needsbuild_title,
	PreferencesMessages.TodoTaskConfigurationBlock_needsbuild_message);

The call above applies the following templates to your message:
{0} A rebuild of the project is required for changes to take effect. Build the project now?
{0} A full rebuild is required for changes to take effect. Do the full build now?

Optionally, you can test the changed preferences and issue rebuild only on change of specific properties.

Regards,
Alex

----- Original Message -----
From: "Gabriel Petrovay" <gabriel.petrovay@xxxxxxxxxx>
To: "dltk-dev" <dltk-dev@xxxxxxxxxxx>
Sent: Sunday, April 26, 2009 4:54:01 AM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] Allowing extensions to AbstractConfigurationBlockPropertyAndPreferencePage  perform... methods

Hi,

I have preference/property pages that are extending the
AbstractConfigurationBlockPropertyAndPreferencePage. These pages also
require a project rebuilding in some cases.

Since the preferences for the project are saved (persited) in the
AbstractConfigurationBlockPropertyAndPreferencePage.performOK(), I
cannot do a proper project rebuilding in the
AbstractOptionsBlock.performOK() since the project does not have the
properties saved yet.

My request would be either:
1. to delete the "final" modifier for the performOK() methods of the
AbstractConfigurationBlockPropertyAndPreferencePage class
or
2. to provide doPerformOK() methods (maybe gove them a better name) in
the class AbstractConfigurationBlockPropertyAndPreferencePage as in
the following example:


	public final boolean performOk() {
		if ((block != null) && !block.performOk()) {
			return false;
		}

		if(!super.performOk())
			return false;

		doPerformOK();
	}

	public abstract boolean doPerformOk(); // or public boolean doPerformOk() { }


This way, one can trigger project rebuilding if needed from various
property or preference pages

Thanks!

Best regards,
Gabriel

-- 
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top