本文整理汇总了Java中org.eclipse.jface.preference.PreferencePage类的典型用法代码示例。如果您正苦于以下问题:Java PreferencePage类的具体用法?Java PreferencePage怎么用?Java PreferencePage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreferencePage类属于org.eclipse.jface.preference包,在下文中一共展示了PreferencePage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPage
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Override
public void createPage() {
try {
setPage(this.pageClass.newInstance());
} catch (InstantiationException|IllegalAccessException e) {
e.printStackTrace();
}
if (getLabelImage() != null) {
getPage().setImageDescriptor(getImageDescriptor());
}
getPage().setTitle(getLabelText());
((PreferencePage)getPage()).setPreferenceStore(
new ScopedPreferenceStore(InstanceScope.INSTANCE, this.nodeQualifier));
}
示例2: createPage
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Override
public void createPage() {
// create the page via DI using the OSGi service context
try {
IPreferencePage page = ContextInjectionFactory.make(this.pageClass, this.context);
setPage(page);
if (getLabelImage() != null) {
getPage().setImageDescriptor(getImageDescriptor());
}
getPage().setTitle(getLabelText());
((PreferencePage) getPage()).setPreferenceStore(this.store);
}
catch (Exception e) {
if (this.logger != null) {
this.logger.log(
LogService.LOG_ERROR,
"Error on creating instance of " + this.pageClass.getName(),
e);
}
}
}
示例3: handleSave
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Override
protected void handleSave() {
final Iterator<IPreferenceNode> nodes = getPreferenceManager().getElements(PreferenceManager.PRE_ORDER).iterator();
while (nodes.hasNext()) {
final IPreferenceNode node = nodes.next();
final IPreferencePage page = node.getPage();
if (page instanceof PreferencePage) {
final IPreferenceStore store = ((PreferencePage) page).getPreferenceStore();
if (store != null && store.needsSaving() && store instanceof IPersistentPreferenceStore) {
try {
((IPersistentPreferenceStore) store).save();
}
catch (final IOException ioe) {
final String message = JFaceMessages.get("err.preferences.save");
logger.log(Level.SEVERE, message, ioe);
EnhancedErrorDialog.openError(getShell(), title, message, IStatus.ERROR, ioe, new Image[] { Display.getCurrent().getSystemImage(SWT.ICON_ERROR) });
}
}
}
}
}
示例4: SaveParticipantConfigurationBlock
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
public SaveParticipantConfigurationBlock(IScopeContext context, PreferencePage preferencePage) {
Assert.isNotNull(context);
Assert.isNotNull(preferencePage);
fContext= context;
fPreferencePage= preferencePage;
fConfigurations= new ArrayList<ISaveParticipantPreferenceConfiguration>();
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:SaveParticipantConfigurationBlock.java
示例5: JavaEditorHoverConfigurationBlock
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
public JavaEditorHoverConfigurationBlock(PreferencePage mainPreferencePage, OverlayPreferenceStore store) {
Assert.isNotNull(mainPreferencePage);
Assert.isNotNull(store);
fMainPreferencePage= mainPreferencePage;
fStore= store;
fStore.addKeys(createOverlayStoreKeys());
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaEditorHoverConfigurationBlock.java
示例6: JDBCSelectionPageHelper
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
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( );
}
示例7: setPreferenceStore
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
private void setPreferenceStore(String bundleId, PreferencePage page)
{
// Affect preference store to this page if this is a
// PreferencePage, else, must manage it internally
// Set the issue#1 on github :
// https://github.com/opcoach/e4Preferences/issues/1
// And manage the extensions of IP
initialisePreferenceStoreProviders();
IPreferenceStore store = null;
// Get the preference store according to policy.
Object data = psProviders.get(bundleId);
if (data != null)
{
if (data instanceof IPreferenceStore)
store = (IPreferenceStore) data;
else if (data instanceof IPreferenceStoreProvider)
store = ((IPreferenceStoreProvider) data).getPreferenceStore();
else if (data instanceof String)
store = (IPreferenceStore) context.get((String) data);
} else
{
// Default behavior : create a preference store for this bundle and remember of it
store = new ScopedPreferenceStore(InstanceScope.INSTANCE, bundleId);
psProviders.put(bundleId, store);
}
if (store != null)
page.setPreferenceStore(store);
else
{
logger.warn("Unable to set the preferenceStore for page " + page.getTitle() + " defined in bundle " + bundleId);
}
}
示例8: pageCreation
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Test
@ConditionalIgnore( condition = CocoaPlatform.class )
public void pageCreation() {
IWorkbenchPreferencePage actual = new RegistryAdapter()
.createExecutableExtension( PREFERENCE_PAGES_EP, IWorkbenchPreferencePage.class )
.thatMatches( attribute( "id", PAGE_ID ) )
.process();
assertThat( actual )
.isInstanceOf( PreferencePage.class );
}
示例9: setPrefPageStatus
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
public static void setPrefPageStatus(PreferencePage prefPage, IStatusMessage status) {
if(!SWTUtil.isOkToUse(prefPage.getControl())) {
return;
}
prefPage.setValid(status == null || !status.getSeverity().isError());
setDialogPageStatus(prefPage, status);
}
示例10: setDialogPageStatus
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
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()));
}
}
示例11: AbstractConfigurationBlock
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
public AbstractConfigurationBlock(OverlayPreferenceStore store, PreferencePage mainPreferencePage) {
Assert.isNotNull(store);
Assert.isNotNull(mainPreferencePage);
fStore = store;
fMainPage = mainPreferencePage;
}
示例12: getRootPreferencePage
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Override
public PreferencePage getRootPreferencePage() {
// TODO Auto-generated method stub
return null;
}
示例13: initBics2
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
protected void initBics2() {
bics2 = new BicsConnector(new BicsConnectorContext() {
@Override
public String getDescription() {
return local.getString("bicsConnector19");
}
@Override
public String getShortName() {
return "bics2";
}
}) {
/**
* Override not needed.
*/
@Override
public PreferencePage getRootPreferencePage() {
return null;
}
/**
* Override not needed.
*/
@Override
public PreferenceNode[] getSecondaryPreferenceNodes() {
return null;
}
/**
* Override not needed.
*/
@Override
protected void createMenuActions() {
}
/**
* Override the initFics2 method to do nothing to avoid the
* recursion.
*/
@Override
protected void initBics2() {
}
};
}
示例14: initFics2
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
protected void initFics2() {
fics2 = new FicsConnector(
new IcsConnectorContext(new IcsParser(false)) {
@Override
public String getDescription() {
return local.getString("ficsConn26");
}
@Override
public String getShortName() {
return "fics2";
}
}) {
/**
* Override not needed.
*/
@Override
public PreferencePage getRootPreferencePage() {
return null;
}
/**
* Override not needed.
*/
@Override
public PreferenceNode[] getSecondaryPreferenceNodes() {
return null;
}
/**
* Override not needed.
*/
@Override
protected void createMenuActions() {
}
/**
* Override the initFics2 method to do nothing to avoid the
* recursion.
*/
@Override
protected void initFics2() {
}
};
fics2.fics1 = this;
}
示例15: getPreferencePage
import org.eclipse.jface.preference.PreferencePage; //导入依赖的package包/类
@Override
public PreferencePage getPreferencePage() {
return null;
}