/******************************************************************************* * Copyright (c) 2008 Oracle. 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: Oracle. - initial API and implementation *******************************************************************************/ package org.eclipse.jpt.eclipselink.ui.internal.orm.details; import java.util.ArrayList; import java.util.ListIterator; import org.eclipse.jpt.eclipselink.core.context.Convert; import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit; import org.eclipse.jpt.eclipselink.ui.internal.mappings.EclipseLinkUiMappingsMessages; import org.eclipse.jpt.ui.WidgetFactory; import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; import org.eclipse.jpt.ui.internal.util.PaneEnabler; import org.eclipse.jpt.ui.internal.util.SWTUtil; import org.eclipse.jpt.ui.internal.widgets.FormPane; import org.eclipse.jpt.utility.internal.CollectionTools; import org.eclipse.jpt.utility.internal.StringConverter; import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel; import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter; import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter; import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel; import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; import org.eclipse.jpt.utility.model.value.ListValueModel; import org.eclipse.jpt.utility.model.value.PropertyValueModel; import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.widgets.Composite; /** * Here the layout of this pane: *
* ----------------------------------------------------------------------------- * | -------------------------------------------------------------- | * | Converter: | |v| | * | -------------------------------------------------------------- | * -----------------------------------------------------------------------------* * @see EclipseLinkConvert * @see EclipseLinkBasicMappingComposite - A container of this widget * * @version 2.1 * @since 2.1 */ //Temporary to remove the Define Converters section from orm basic, id, version mapping. //This is supported in EclipseLink in version 1.1, but not 1.0 public class OrmConvertComposite extends FormPane
null
. This key is most
* likely never typed the user and it will help to convert the value to
* null
when it's time to set the new selected value into the
* model.
*/
protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?"; //$NON-NLS-1$
/**
* Creates a new EnumTypeComposite
.
*
* @param parentPane The parent container of this one
* @param parent The parent container
*/
public OrmConvertComposite(PropertyValueModel extends Convert> subjectHolder,
Composite parent,
WidgetFactory widgetFactory) {
super(subjectHolder, parent, widgetFactory);
}
@Override
protected void initializeLayout(Composite container) {
CCombo combo = addLabeledEditableCCombo(
container,
EclipseLinkUiMappingsMessages.ConvertComposite_converterNameLabel,
buildConvertNameListHolder(),
buildConvertNameHolder(),
buildNameConverter(),
null
);
SWTUtil.attachDefaultValueHandler(combo);
new PaneEnabler(buildBooleanHolder(), this);
}
protected final WritablePropertyValueModel