diff options
Diffstat (limited to 'bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui')
2 files changed, 0 insertions, 262 deletions
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java deleted file mode 100644 index 47f0f07cb5..0000000000 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 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.css.ui.internal.contentproperties.ui; - - - -import java.util.Map; - -import org.eclipse.core.resources.IResource; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.css.ui.internal.Logger; -import org.eclipse.wst.css.ui.internal.contentproperties.ContentSettingsRegistry; -import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds; -import org.eclipse.wst.sse.internal.contentproperties.IContentSettings; -import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage; -import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage; - -/** - * @deprecated Use CSSWebContentSettingsPropertyPage instead - */ -public final class CSSContentSettingsPropertyPage extends ContentSettingsPropertyPage { - - private final int N_CSS_PROFILE = 0; - - - - public CSSContentSettingsPropertyPage() { - super(); - numberOfCombo = 1; - numCols = 2; - numRows = 1; - combo = new ComboListOnPropertyPage[super.numberOfCombo]; - - } - - protected void createCSSComboBox() { - super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL); - ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]); - if (combo[N_CSS_PROFILE].getItemCount() <= 0) - return; - String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE); - // when either .contentsettings or element doesn't exist - // when attribute doesn't exists,getProperty returns empty string. - if (initValue == null) - initValue = ""; //$NON-NLS-1$ - // set init selectionItem in Combo - super.setSelectionItem(combo[N_CSS_PROFILE], initValue); - } - - - - protected void createSettingsPageGUI() { - - int type = ((IResource) getElement()).getType(); - switch (type) { - case IResource.FILE : - //composite = createComposite(propertyPage,numCols,numRows); - createCSSComboBox(); - PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID); - break; - - default : - Logger.log(Logger.WARNING, "CSSContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$ - break; - } - - } - - - protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) { - - switch (index) { - case N_CSS_PROFILE : - // css - properties.put(IContentSettings.CSS_PROFILE, valueInCombo); - break; - default : - Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$ - break; - } - - } - - protected void deleteNoneProperty(int index) { - switch (index) { - case N_CSS_PROFILE : - // css - contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE); - break; - - default : - Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$ - break; - } - } - -} - diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java deleted file mode 100644 index 7e1dff427e..0000000000 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java +++ /dev/null @@ -1,156 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2004, 2006 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 - * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences - ****************************************************************************/ -package org.eclipse.wst.css.ui.internal.contentproperties.ui; - - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.PropertyPage; -import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties; -import org.eclipse.wst.css.core.internal.metamodel.CSSProfile; -import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry; -import org.eclipse.wst.css.ui.internal.CSSUIMessages; -import org.eclipse.wst.css.ui.internal.Logger; -import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds; - -public final class CSSWebContentSettingsPropertyPage extends PropertyPage { - private static final String SELECT_NONE = CSSUIMessages.UI_none; - - private Combo fProfileCombo; - private List fProfileIds; - - public CSSWebContentSettingsPropertyPage() { - super(); - setDescription(CSSUIMessages.CSSContentSettingsPropertyPage_0); - } - - private Composite createComposite(Composite parent, int numColumns) { - Composite composite = new Composite(parent, SWT.NULL); - - // GridLayout - GridLayout layout = new GridLayout(); - layout.numColumns = numColumns; - composite.setLayout(layout); - - // GridData - GridData data = new GridData(GridData.FILL, GridData.FILL, true, false); - data.horizontalIndent = 0; - composite.setLayoutData(data); - - return composite; - } - - protected Control createContents(Composite parent) { - Composite propertyPage = createComposite(parent, 2); - - // CSS Profile control - Text languageLabel = new Text(propertyPage, SWT.READ_ONLY); - languageLabel.setText(CSSUIMessages.CSSContentSettingsPropertyPage_1); - fProfileCombo = new Combo(propertyPage, SWT.READ_ONLY); - GridData data = new GridData(GridData.FILL, GridData.FILL, true, false); - data.horizontalIndent = 0; - fProfileCombo.setLayoutData(data); - - populateValues(); - initializeValues(); - - PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID); - Dialog.applyDialogFont(parent); - return propertyPage; - } - - /** - * Get the resource this properties page is for - * - * @return IResource for this properties page or null if there is no - * IResource - */ - private IResource getResource() { - IResource resource = null; - if (getElement() instanceof IResource) { - resource = (IResource) getElement(); - } - return resource; - } - - private void initializeValues() { - int index = 0; - String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false); - if (profile != null && profile.length() > 0) { - /* - * If item is already part of combo, select it. Otherwise, select - * none. - */ - index = fProfileIds.indexOf(profile); - } - index = index >= 0 ? index : 0; - fProfileCombo.select(index); - } - - private void populateValues() { - fProfileIds = new ArrayList(); - // add none first - fProfileCombo.add(SELECT_NONE); - fProfileIds.add(null); - - CSSProfileRegistry reg = CSSProfileRegistry.getInstance(); - Iterator i = reg.getProfiles(); - while (i.hasNext()) { - CSSProfile profile = (CSSProfile) i.next(); - String id = profile.getProfileID(); - String name = profile.getProfileName(); - fProfileCombo.add(name); - fProfileIds.add(id); - } - } - - protected void performDefaults() { - int index = fProfileCombo.indexOf(SELECT_NONE); - if (index > -1) - fProfileCombo.select(index); - - super.performDefaults(); - } - - public boolean performOk() { - int index = fProfileCombo.getSelectionIndex(); - if (index > -1) { - String id = (String) fProfileIds.get(index); - if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) { - // if none, use null - id = null; - } - try { - CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id); - } - catch (CoreException e) { - // maybe in future, let user know there was a problem saving - // file - Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e); - } - } - return super.performOk(); - } -} |