Java 类org.eclipse.jface.preference.IPreferencePageContainer 实例源码

项目:APICloud-Studio    文件:ValidationPreferencePage.java   
@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;
}
项目:Eclipse-Postfix-Code-Completion    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * {@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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * {@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;
}
项目:n4js    文件:N4JSBuilderPreferencePage.java   
/**
 * 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());
        }
    }
}
项目:n4js    文件:N4JSBuilderPreferencePage.java   
/**
 * 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();
    }
}
项目:team-explorer-everywhere    文件:PreferenceLinkAreaHelper.java   
/**
 * Builds a PreferenceLinkArea if the platform supports it. On platforms
 * that do not support a PreferenceLinkArea, you will be returned an empty
 * control which has no size and does nothing.
 *
 * @return A Control that can be used to link to the preference area, if
 *         supported, or an empty control if the platform does not support
 *         preference links
 */
public static Control createPreferenceLinkArea(
    final Composite parent,
    final int style,
    final String pageId,
    final String message,
    final IPreferencePageContainer container,
    final Object pageData) {
    try {
        final Class preferenceLinkClass = Class.forName("org.eclipse.ui.dialogs.PreferenceLinkArea"); //$NON-NLS-1$
        final Class workbenchPrefContainerClass =
            Class.forName("org.eclipse.ui.preferences.IWorkbenchPreferenceContainer"); //$NON-NLS-1$

        final Constructor preferenceLinkCtor = preferenceLinkClass.getConstructor(new Class[] {
            Composite.class,
            int.class,
            String.class,
            String.class,
            workbenchPrefContainerClass,
            Object.class
        });

        final Object preferenceLinkArea = preferenceLinkCtor.newInstance(new Object[] {
            parent,
            new Integer(style),
            pageId,
            message,
            container,
            pageData
        });

        final Method getControlMethod = preferenceLinkClass.getMethod("getControl", (Class[]) null); //$NON-NLS-1$
        return (Control) getControlMethod.invoke(preferenceLinkArea, (Object[]) null);
    } catch (final Exception e) {
        return new EmptyControl(parent, style);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:SaveParticipantConfigurationBlock.java   
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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SaveParticipantConfigurationBlock.java   
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;
}
项目:antlr4ide    文件:BuilderPreferencePage.java   
@Override
 protected Control createPreferenceContent(final Composite composite,
     final IPreferencePageContainer preferencePageContainer) {
console.debug("BuilderPreferencePage createPreferenceContent ");

   return builderConfigurationBlock.createContents(composite);
 }
项目:antlr4ide    文件:BuilderPreferencePage.java   
private void scheduleCleanerJobIfNecessary(final IPreferencePageContainer preferencePageContainer) {
console.debug("BuilderPreferencePage scheduleCleanerJobIfNecessary");

   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());
     }
   }
 }
项目:antlr4ide    文件:BuilderPreferencePage.java   
private void scheduleCleanerJob(final IPreferencePageContainer preferencePageContainer,
     final String folderNameToClean) {
console.debug("BuilderPreferencePage scheduleCleanerJob");

   DerivedResourceCleanerJob derivedResourceCleanerJob = cleanerProvider.get();
   derivedResourceCleanerJob.setUser(true);
   derivedResourceCleanerJob.initialize(getProject(), folderNameToClean);
   if (preferencePageContainer != null) {
     IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
     container.registerUpdateJob(derivedResourceCleanerJob);
   } else {
     derivedResourceCleanerJob.schedule();
   }
 }
项目:birt    文件:PropertyPageWrapper.java   
public Control createPageControl( Composite parent )
{
    propertyPage.setContainer( (IPreferencePageContainer) getContainer( ) );
    propertyPage.createControl( parent );

    return propertyPage.getControl( );
}
项目:team-explorer-everywhere    文件:TFSGlobalProxiesControl.java   
public TFSGlobalProxiesControl(
    final Composite parent,
    final int style,
    final IPreferencePageContainer preferencePageContainer) {
    super(parent, style);

    final int verticalSectionSpacing = ControlSize.convertCharHeightToPixels(this, 1) * 2;

    final GridLayout layout = SWTUtil.gridLayout(this, 2);
    layout.verticalSpacing = verticalSectionSpacing;

    SWTUtil.createLabel(this, getDisplay().getSystemImage(SWT.ICON_INFORMATION));

    final String messageFormat = Messages.getString("TFSGlobalProxiesControl.SummaryLabelTextFormat"); //$NON-NLS-1$
    final String message = MessageFormat.format(messageFormat, ProductInformation.getCurrent().toString());
    final Label label = SWTUtil.createLabel(this, SWT.WRAP, message);

    GridDataBuilder.newInstance().hGrab().hFill().wCHint(label, 80).applyTo(label);

    final boolean showHttpProxyControls =
        TFSCommonUIClientPlugin.getDefault().getProxyServiceTracker().getService() == null;

    if (showHttpProxyControls) {
        httpProxyControl = new HTTPProxyControl(this, SWT.NONE);
        AutomationIDHelper.setWidgetID(httpProxyControl, HTTP_PROXY_CONTROL);
        httpProxyControl.getGridLayout().marginHeight = 0;
        httpProxyControl.getGridLayout().marginWidth = 0;
        multiValidator.addValidatable(httpProxyControl);
        GridDataBuilder.newInstance().hGrab().hFill().hSpan(layout).applyTo(httpProxyControl);
    } else {
        httpProxyControl = null;
    }

    tfProxyControl = new TFSProxyControl(this, SWT.NONE);
    AutomationIDHelper.setWidgetID(tfProxyControl, TFS_PROXY_CONTROL);
    tfProxyControl.getGridLayout().marginHeight = 0;
    tfProxyControl.getGridLayout().marginWidth = 0;
    multiValidator.addValidatable(tfProxyControl);
    GridDataBuilder.newInstance().hGrab().hFill().hSpan(layout).applyTo(tfProxyControl);

    if (httpProxyControl != null) {
        ControlSize.align(new Alignable[] {
            httpProxyControl,
            tfProxyControl
        });
    }

    if (!showHttpProxyControls) {
        final Control linkControl =
            PreferenceLinkAreaHelper.createPreferenceLinkArea(
                this,
                SWT.NONE,
                "org.eclipse.ui.net.NetPreferences", //$NON-NLS-1$
                Messages.getString("TFSGlobalProxiesControl.ClickHereToConfigureHttp"), //$NON-NLS-1$
                preferencePageContainer,
                null);

        GridDataBuilder.newInstance().hGrab().hFill().hSpan(layout).applyTo(linkControl);
    }
}
项目:fluentmark    文件:PrefPageConvert.java   
@Override
public IPreferencePageContainer getContainer() {
    return super.getContainer();
}
项目:fluentmark    文件:PrefPageConvert.java   
@Override
public void setContainer(IPreferencePageContainer container) {
    super.setContainer(container);
}
项目:bts    文件:ValidatorPreferencePage.java   
@Override
protected Control createPreferenceContent(Composite composite, IPreferencePageContainer preferencePageContainer) {
    return validatorConfigurationBlock.createContents(composite);
}
项目:bts    文件:PropertyAndPreferencePage.java   
protected abstract Control createPreferenceContent(Composite composite,
IPreferencePageContainer preferencePageContainer);
项目:eclipseforces    文件:JavaPreferencesPage.java   
@Override
public void setContainer(IPreferencePageContainer preferencePageContainer) {
  // do nothing
}
项目:APICloud-Studio    文件:SpellingPreferencePage.java   
@Override
public void setContainer(IPreferencePageContainer container)
{
    super.setContainer(container);
    updateStatus();
}
项目:idecore    文件:ProjectUpdateOperation.java   
public ProjectUpdateOperation(ProjectController projectController, IPreferencePageContainer container) {
    super(projectController);
}
项目:Eclipse-Postfix-Code-Completion    文件:ISaveParticipantPreferenceConfiguration.java   
/**
 * 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);
项目:Eclipse-Postfix-Code-Completion    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * 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
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ISaveParticipantPreferenceConfiguration.java   
/**
 * 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);
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * 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
}