org.eclipse.jface.preference.PreferencePage Java Examples

The following examples show how to use org.eclipse.jface.preference.PreferencePage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SaveParticipantConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public SaveParticipantConfigurationBlock(IScopeContext context, PreferencePage preferencePage) {
	Assert.isNotNull(context);
	Assert.isNotNull(preferencePage);

	fContext= context;
	fPreferencePage= preferencePage;
	fConfigurations= new ArrayList<ISaveParticipantPreferenceConfiguration>();
}
 
Example #2
Source File: DialogPageUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public static void setDialogPageStatus(PreferencePage prefPage, IStatusMessage status) {
	if(!SWTUtil.isOkToUse(prefPage.getControl())) {
		return;
	}
	
	if(status == null) {
		prefPage.setMessage(null);
	} else {
		prefPage.setMessage(status.getMessage(), severityToMessageType(status.getSeverity()));
	}
}
 
Example #3
Source File: JavaEditorHoverConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public JavaEditorHoverConfigurationBlock(PreferencePage mainPreferencePage, OverlayPreferenceStore store) {
	Assert.isNotNull(mainPreferencePage);
	Assert.isNotNull(store);
	fMainPreferencePage= mainPreferencePage;
	fStore= store;
	fStore.addKeys(createOverlayStoreKeys());
}
 
Example #4
Source File: DialogPageUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public static void setPrefPageStatus(PreferencePage prefPage, IStatusMessage status) {
	if(!SWTUtil.isOkToUse(prefPage.getControl())) {
		return;
	}
	
	prefPage.setValid(status == null || !status.getSeverity().isError());
	
	setDialogPageStatus(prefPage, status);
}
 
Example #5
Source File: JDBCSelectionPageHelper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
JDBCSelectionPageHelper( PreferencePage page )
{
	DEFAULT_MESSAGE = JdbcPlugin.getResourceString( "wizard.message.editDataSource" ); //$NON-NLS-1$
	m_propertyPage = page;
	if ( page instanceof JDBCPropertyPage ) // bidi_hcg
		bidiSupportObj = ( (JDBCPropertyPage) page ).getBidiSupport( );
}
 
Example #6
Source File: DialogPageUtils.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public static void applyStatusToPage(PreferencePage preferencePage, IStatus status) {
	preferencePage.setValid(status.isOK());
	applyStatusToPage(preferencePage, status);
}
 
Example #7
Source File: Config.java    From pmTrans with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void showConfigurationDialog(Shell parent) throws PmTransException {
	// Create the preference manager
	PreferenceManager mgr = new PreferenceManager();

	// Create the nodes
	PreferenceNode playbackNode = new PreferenceNode("playbackPreferences");
	PreferencePage playbackPage = new FieldEditorPreferencePage() {
		@Override
		protected void createFieldEditors() {
			addField(new IntegerFieldEditor(SHORT_REWIND,
					"Short rewind duration (in sec)",
					getFieldEditorParent()));
			addField(new IntegerFieldEditor(LONG_REWIND,
					"Long rewind duration (in sec)", getFieldEditorParent()));
			addField(new IntegerFieldEditor(REWIND_AND_PLAY,
					"Rewind-and-resume duartion duration (in sec)",
					getFieldEditorParent()));
			addField(new IntegerFieldEditor(LOOP_FRECUENCY,
					"Loops frecuency (in seconds)", getFieldEditorParent()));
			addField(new IntegerFieldEditor(LOOP_LENGHT,
					"Loop rewind lenght (in seconds)",
					getFieldEditorParent()));
		}
	};
	playbackPage.setTitle("Playback preferences");
	playbackNode.setPage(playbackPage);

	PreferenceNode shortcutsNode = new PreferenceNode(
			"shortcutsPreferences");
	PreferencePage shortcutsPage = new FieldEditorPreferencePage() {
		@Override
		protected void createFieldEditors() {
			addField(new ShortcutFieldEditor(SHORT_REWIND_KEY,
					"Short rewind", getFieldEditorParent()));
			addField(new ShortcutFieldEditor(LONG_REWIND_KEY,
					"Long rewind", getFieldEditorParent()));
			addField(new ShortcutFieldEditor(PAUSE_KEY, "Pause and resume",
					getFieldEditorParent()));
			addField(new ShortcutFieldEditor(AUDIO_LOOPS_KEY,
					"Enable audio loops", getFieldEditorParent()));
			addField(new ShortcutFieldEditor(SLOW_DOWN_KEY,
					"Slow down audio playback", getFieldEditorParent()));
			addField(new ShortcutFieldEditor(SPEED_UP_KEY,
					"Speed up audio playback", getFieldEditorParent()));
			addField(new ShortcutFieldEditor(TIMESTAMP_KEY,
					"Insert timestamp", getFieldEditorParent()));
		}
	};
	shortcutsPage.setTitle("Shortcuts preferences");
	shortcutsNode.setPage(shortcutsPage);

	PreferenceNode generalNode = new PreferenceNode("generalPreferences");
	PreferencePage generalPage = new FieldEditorPreferencePage() {
		@Override
		protected void createFieldEditors() {
			addField(new IntegerFieldEditor(AUDIO_FILE_CACHE_LENGHT,
					"Max size of the \"recent audio files\" list",
					getFieldEditorParent()));
			addField(new IntegerFieldEditor(TEXT_FILE_CACHE_LENGHT,
					"Max size of the \"recent text files\" list",
					getFieldEditorParent()));
			// TODO add a separator here
			addField(new BooleanFieldEditor(AUTO_SAVE, "Auto save",
					getFieldEditorParent()));
			addField(new IntegerFieldEditor(AUTO_SAVE_TIME,
					"Auto save frecuency (in minutes)",
					getFieldEditorParent()));
		}
	};
	generalPage.setTitle("General preferences");
	generalNode.setPage(generalPage);

	mgr.addToRoot(playbackNode);
	mgr.addToRoot(shortcutsNode);
	mgr.addToRoot(generalNode);
	PreferenceDialog dlg = new PreferenceDialog(parent, mgr);
	dlg.setPreferenceStore(this);

	if (dlg.open() == PreferenceDialog.OK)
		try {
			save();
		} catch (IOException e) {
			throw new PmTransException("Unable to save preferences", e);
		}
}
 
Example #8
Source File: PyEditorHoverConfigurationBlock.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public PyEditorHoverConfigurationBlock(PreferencePage mainPreferencePage) {
    Assert.isNotNull(mainPreferencePage);
    fMainPreferencePage = mainPreferencePage;
}
 
Example #9
Source File: E4PreferenceNode.java    From e4Preferences with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPage()
{
	if (clazz == null)
	{
		loadClass();
	}

	PreferencePage page = null;

	try
	{
		page = clazz.newInstance();
	} catch (InstantiationException  | IllegalAccessException e)
	{
		String explain = "";
		if (e instanceof IllegalAccessException)
		{
			explain="The class should have a PUBLIC default constructor (check its modifier)";

		}
		getLogger().error(e, MessageFormat.format("Unable to create the E4 Preference page with class name = {0} from bundle = {1} " + explain, clazz.getCanonicalName(), bundleID));
		

	}

	if (page != null && page instanceof PreferencePage)
	{
		if (getLabelImage() != null)
		{
			page.setImageDescriptor(getImageDescriptor());
		}
		page.setTitle(getLabelText());
		setPage(page);

		if (page.getPreferenceStore() == null)
			setPreferenceStore(page);

		// Must inject only when preferenceStore is set (or listening will not be done) !
		ContextInjectionFactory.inject(page, context);
	}
}
 
Example #10
Source File: MongoDBDataSourcePageHelper.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public MongoDBDataSourcePageHelper( PreferencePage page )
{
	propertyPage = page;
	isPropertyPage = true;
}
 
Example #11
Source File: HiveSelectionPageHelper.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public HiveSelectionPageHelper( PreferencePage page, String odaDesignerID )
{
    m_propertyPage = page;
    setDefaultMessage( odaDesignerID );
}
 
Example #12
Source File: SampleDbSelectionPageHelper.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
SampleDbSelectionPageHelper( PreferencePage page )
{
    m_propertyPage = page;
}
 
Example #13
Source File: RoutesKarafRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new RoutesKarafRepositorySettingPage(this.getNode());
}
 
Example #14
Source File: RoutesKarafPomRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new RoutesKarafPomRepositorySettingPage(getFile());
}
 
Example #15
Source File: RoutesKarafFeatureRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new RoutesKarafFeatureRepositorySettingPage(getFile());
}
 
Example #16
Source File: RoutesKarafParentRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new RoutesKarafParentRepositorySettingPage(getFile());
}
 
Example #17
Source File: RoutesKarafBundleRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new RoutesKarafBundleRepositorySettingPage(getFile());
}
 
Example #18
Source File: ServicesKarafPomRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new ServicesKarafPomRepositorySettingPage(getFile());
}
 
Example #19
Source File: ServicesKarafFeatureRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new ServicesKarafFeatureRepositorySettingPage(getFile());
}
 
Example #20
Source File: ServicesKarafBundleRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new ServicesKarafBundleRepositorySettingPage(getFile());
}
 
Example #21
Source File: ServicesKarafRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new ServicesKarafRepositorySettingPage(this.getNode());
}
 
Example #22
Source File: ServicesKarafParentRepositorySettingNode.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
protected PreferencePage createPreferencePage() {
    return new ServicesKarafParentRepositorySettingPage(getFile());
}
 
Example #23
Source File: AbstractConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public AbstractConfigurationBlock(OverlayPreferenceStore store, PreferencePage mainPreferencePage) {
	Assert.isNotNull(store);
	Assert.isNotNull(mainPreferencePage);
	fStore= store;
	fMainPage= mainPreferencePage;
}
 
Example #24
Source File: JavaEditorAppearanceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public JavaEditorAppearanceConfigurationBlock(PreferencePage mainPreferencePage, OverlayPreferenceStore store) {
	super(store, mainPreferencePage);
	getPreferenceStore().addKeys(createOverlayStoreKeys());
}