diff options
author | nitind | 2010-12-31 08:27:32 +0000 |
---|---|---|
committer | nitind | 2010-12-31 08:27:32 +0000 |
commit | d72d517eedd1c3a3ffe636c08d1cc91e81821a36 (patch) | |
tree | 0569be1345daf33b1bb3d424d4c8faa8ef4799b7 /bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal | |
parent | ab2bbe3fa083b086115f37b12f3a49742e2a01e0 (diff) | |
download | webtools.sourceediting-d72d517eedd1c3a3ffe636c08d1cc91e81821a36.tar.gz webtools.sourceediting-d72d517eedd1c3a3ffe636c08d1cc91e81821a36.tar.xz webtools.sourceediting-d72d517eedd1c3a3ffe636c08d1cc91e81821a36.zip |
[333359] Make showing the Properties view when opening the editor optional
Diffstat (limited to 'bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal')
6 files changed, 87 insertions, 15 deletions
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java index 710f2c761c..c07421038b 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -73,6 +73,7 @@ public class DTDUIMessages extends NLS { public static String SyntaxColoringPage_5; public static String SyntaxColoringPage_6; public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK; + public static String ShowProperties; static { // load message values from bundle file diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties index 6fff1f81aa..44a4572129 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties @@ -86,5 +86,6 @@ SyntaxColoringPage_4=&Italic SyntaxColoringPage_5=&Strikethrough SyntaxColoringPage_6=&Underline -_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=DTD preferences. Note that some preferences may be set on the <a>{0}</a> preference page. +_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=DTD editor preferences. Note that some preferences may be set on the <a>{0}</a> preference page. +ShowProperties=Automatically show the Properties view diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java new file mode 100644 index 0000000000..ac3eb60385 --- /dev/null +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * + *******************************************************************************/ +package org.eclipse.wst.dtd.ui.internal.preferences; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.dialogs.PreferenceLinkArea; +import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; +import org.eclipse.wst.dtd.ui.internal.DTDUIMessages; +import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin; + +public class DTDEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { + + public DTDEditorPreferencePage() { + super(); + } + + + public DTDEditorPreferencePage(int style) { + super(style); + } + + + public DTDEditorPreferencePage(String title, ImageDescriptor image, int style) { + super(title, image, style); + } + + + public DTDEditorPreferencePage(String title, int style) { + super(title, style); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors + * () + */ + protected void createFieldEditors() { + addField(new BooleanFieldEditor(DTDUIPreferenceNames.ACTIVATE_PROPERTIES, DTDUIMessages.ShowProperties, getFieldEditorParent())); + } + + protected Control createContents(Composite parent) { + setPreferenceStore(DTDUIPlugin.getDefault().getPreferenceStore()); + new PreferenceLinkArea(parent, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", DTDUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).grab(true, false).create());//$NON-NLS-1$ + new Label(parent, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create()); + return super.createContents(parent); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) { + } +} diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java index 7bff14c6cc..8603cfb387 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,18 +20,13 @@ import java.util.List; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Preferences; import org.eclipse.core.runtime.content.IContentType; -import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.PreferenceLinkArea; -import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; import org.eclipse.wst.dtd.core.internal.DTDCorePlugin; import org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceNames; import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD; @@ -49,11 +44,6 @@ public class DTDFilesPreferencePage extends AbstractPreferencePage { Composite composite = super.createComposite(parent, 1); PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.DTD_PREFWEBX_FILES_HELPID); - new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", DTDUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$ - (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create()); - new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create()); - - Group creatingGroup = createGroup(composite, 2); creatingGroup.setText(DTDUIMessages.Creating_files); diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java index 3f6f2c645c..c80d99065f 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -73,5 +73,7 @@ public class DTDUIPreferenceInitializer extends AbstractPreferenceInitializer { if (template != null) templateName = template.getName(); store.setDefault(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName); + + store.setDefault(DTDUIPreferenceNames.ACTIVATE_PROPERTIES, true); } } diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java index 73f2f71d8f..64d5ec6494 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,4 +34,6 @@ public class DTDUIPreferenceNames { * </p> */ public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$ + + public static final String ACTIVATE_PROPERTIES = "activateProperties"; //$NON-NLS-1$ } |