org.eclipse.jface.preference.IPreferencePageContainer Java Examples

The following examples show how to use org.eclipse.jface.preference.IPreferencePageContainer. 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: DebugPreferencePage.java    From corrosion with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	Composite container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout(4, false));
	container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));

	gdbInput = new InputComponent(container, Messages.DebugPreferencePage_defaultGDB, e -> isPageValid());
	gdbInput.createComponent();
	gdbInput.createFileSelection();
	gdbInput.setValue(store.getString(CorrosionPreferenceInitializer.DEFAULT_GDB_PREFERENCE));

	Link gdbLink = new Link(container, SWT.NONE);
	gdbLink.setText(Messages.DebugPreferencePage_seeGDBPage);
	gdbLink.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
		IPreferencePageContainer prefContainer = getContainer();
		if (prefContainer instanceof IWorkbenchPreferenceContainer) {
			((IWorkbenchPreferenceContainer) prefContainer).openPage("org.eclipse.cdt.dsf.gdb.ui.preferences", //$NON-NLS-1$
					null);
		}
	}));
	gdbLink.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	return parent;
}
 
Example #2
Source File: AbstractSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public Control createControl(Composite parent, IPreferencePageContainer container) {
	Composite composite= new Composite(parent, SWT.NONE);
	GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true);
	composite.setLayoutData(gridData);
	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	composite.setLayout(layout);

	fEnableField= new SelectionButtonDialogField(SWT.CHECK);
	fEnableField.setLabelText(getPostSaveListenerName());
	fEnableField.doFillIntoGrid(composite, 1);

	createConfigControl(composite, container);

	return composite;
}
 
Example #3
Source File: ValidationPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performOk()
{
	final boolean rebuild = rebuild();
	final boolean reReconcile = needsReconcile();
	Job buildJob = new ApplyChangesAndBuildJob(Messages.ValidationPreferencePage_RebuildJobTitle, rebuild,
			reReconcile);

	IPreferencePageContainer container = getContainer();
	if (container instanceof IWorkbenchPreferenceContainer)
	{
		((IWorkbenchPreferenceContainer) container).registerUpdateJob(buildJob);
	}
	else
	{
		buildJob.schedule();
	}

	return true;
}
 
Example #4
Source File: BuilderPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void scheduleCleanerJob(IPreferencePageContainer preferencePageContainer, String folderNameToClean) {
	DerivedResourceCleanerJob derivedResourceCleanerJob = cleanerProvider.get();
	derivedResourceCleanerJob.setUser(true);
	derivedResourceCleanerJob.initialize(getProject(), folderNameToClean);
	if (preferencePageContainer != null) {
		IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
		container.registerUpdateJob(derivedResourceCleanerJob);
	} else {
		derivedResourceCleanerJob.schedule();
	}
}
 
Example #5
Source File: PropertyPageWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Control createPageControl( Composite parent )
{
	propertyPage.setContainer( (IPreferencePageContainer) getContainer( ) );
	propertyPage.createControl( parent );

	return propertyPage.getControl( );
}
 
Example #6
Source File: SaveParticipantConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public Control createControl(Composite parent) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
   	GridLayout gridLayout= new GridLayout(2, false);
   	gridLayout.marginHeight= 0;
   	gridLayout.marginWidth= 0;
	composite.setLayout(gridLayout);

	SaveParticipantRegistry registry= JavaPlugin.getDefault().getSaveParticipantRegistry();
	SaveParticipantDescriptor[] descriptors= registry.getSaveParticipantDescriptors();

	if (descriptors.length == 0)
		return composite;

	Arrays.sort(descriptors, new Comparator<SaveParticipantDescriptor>() {
		public int compare(SaveParticipantDescriptor d1, SaveParticipantDescriptor d2) {
			return Collator.getInstance().compare(d1.getPostSaveListener().getName(), d2.getPostSaveListener().getName());
		}
	});

	IPreferencePageContainer container= fPreferencePage.getContainer();
	for (int i= 0; i < descriptors.length; i++) {
		final SaveParticipantDescriptor descriptor= descriptors[i];
		ISaveParticipantPreferenceConfiguration configuration= descriptor.createPreferenceConfiguration();
		configuration.createControl(composite, container);
		fConfigurations.add(configuration);
	}

	return composite;
}
 
Example #7
Source File: N4JSBuilderPreferencePage.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This method has been copied from org.eclipse.xtext.builder.preferences.BuilderPreferencePage.
 */
private void scheduleCleanerJobIfNecessary(IPreferencePageContainer preferencePageContainer) {
	Map<String, ValueDifference<String>> changes = getPreferenceChanges();
	for (String key : changes.keySet()) {
		if (key.matches("^" + CompilerProperties.OUTPUT_PREFERENCE_TAG + "\\.\\w+\\."
				+ CompilerProperties.OUTPUT_PREFERENCE_TAG + "$")) {
			ValueDifference<String> difference = changes.get(key);
			scheduleCleanerJob(preferencePageContainer, difference.rightValue());
		}
	}
}
 
Example #8
Source File: BuilderPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void scheduleCleanerJobIfNecessary(IPreferencePageContainer preferencePageContainer) {
	Map<String, ValueDifference<String>> changes = builderConfigurationBlock.getPreferenceChanges();
	for (String key : changes.keySet()) {
		if (key.matches("^" + EclipseOutputConfigurationProvider.OUTPUT_PREFERENCE_TAG + "\\.\\w+\\."
				+ EclipseOutputConfigurationProvider.OUTPUT_DIRECTORY + "$")) {
			ValueDifference<String> difference = changes.get(key);
			scheduleCleanerJob(preferencePageContainer, difference.rightValue());
		}
	}
}
 
Example #9
Source File: N4JSBuilderPreferencePage.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This method has been copied from org.eclipse.xtext.builder.preferences.BuilderPreferencePage.
 */
private void scheduleCleanerJob(IPreferencePageContainer preferencePageContainer, String folderNameToClean) {
	DerivedResourceCleanerJob derivedResourceCleanerJob = cleanerProvider.get();
	derivedResourceCleanerJob.setUser(true);
	derivedResourceCleanerJob.initialize(getProject(), folderNameToClean);
	if (preferencePageContainer != null) {
		IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
		container.registerUpdateJob(derivedResourceCleanerJob);
	} else {
		derivedResourceCleanerJob.schedule();
	}
}
 
Example #10
Source File: BuilderPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createPreferenceContent(Composite composite, IPreferencePageContainer preferencePageContainer) {
	return builderConfigurationBlock.createContents(composite);
}
 
Example #11
Source File: PropertyAndPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected abstract Control createPreferenceContent(Composite composite,
IPreferencePageContainer preferencePageContainer);
 
Example #12
Source File: SpellingPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setContainer(IPreferencePageContainer container)
{
	super.setContainer(container);
	updateStatus();
}
 
Example #13
Source File: TaskTagPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createPreferenceContent(Composite composite, IPreferencePageContainer preferencePageContainer) {
	return taskConfigurationBlock.createContents(composite);
}
 
Example #14
Source File: ValidatorPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createPreferenceContent(Composite composite, IPreferencePageContainer preferencePageContainer) {
	return validatorConfigurationBlock.createContents(composite);
}
 
Example #15
Source File: AbstractExtraLanguagePropertyPage.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
protected Control createPreferenceContent(Composite composite, IPreferencePageContainer preferencePageContainer) {
	return this.builderConfigurationBlock.createContents(composite);
}
 
Example #16
Source File: ISaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a control that will be displayed on the Java &gt; Editor &gt; Save Participants
 * preference page to edit the details of a save participant.
 *
 * @param parent the parent composite to which to add the preferences control
 * @param container the container in which this preference configuration is displayed
 * @return the control that was added to the <code>parent</code>
 */
Control createControl(Composite parent, IPreferencePageContainer container);
 
Example #17
Source File: AbstractSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Subclasses can add specific controls
 *
 * @param parent the parent to use to add the control to
 * @param container the container showing the preferences
 */
protected void createConfigControl(Composite parent, IPreferencePageContainer container) {
	//Default has no specific controls
}