blob: ec1bf2cbd56eb2b6500458fe90cbacbff49e39e1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 Sybase, Inc. 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:
* Sybase, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.pagedesigner.meta;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
import org.eclipse.jst.pagedesigner.meta.internal.XXXDefaultEditorCreator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
/**
* @author mengbo
* @version 1.5
* @deprecated
* will be deleted (was EditorCreator)
*/
public abstract class XXXEditorCreator {
static XXXEditorCreator _instance;
static IBindingHandler _defaultHandler = new BindingHandlerDelegate();
/**
* Cell editor holder
*
*/
public static interface CellEditorHolder {
/**
* @param parent
* @return the cell editor
*/
public CellEditor createCellEditor(Composite parent);
}
/**
* Create a dialog field without databinding using the specified attribute
* descriptor.
*
* @param attr
* @return DialogField
*/
public abstract DialogField createDialogField(IAttributeDescriptor attr);
/**
* Create a dialog field that will have databinding support. Basically, this
* method will create a normal dialog field using the attribute descriptor,
* then make a wrapper on it.
*
* @param uri
* the namespace uri
* @param tagName
* the local tag name
* @param attr
* @param handler
* if null, system default mechanism will be used.
* @return DialogField
*/
public abstract DialogField createDialogFieldWithWrapper(String uri,
String tagName, IAttributeDescriptor attr, IBindingHandler handler);
/**
* @param descriptor
* @param handler
* @return the dialog field
*/
public abstract DialogField createDialogFieldWithWrapper(IPropertyPageDescriptor descriptor, IBindingHandler handler);
//
// /**
// * Create a dialog field that will have databinding support. Basically, this
// * method will create a normal dialog field using the attribute descriptor,
// * then make a wrapper on it.
// *
// * @param uri
// * the namespace uri
// * @param tagName
// * the local tag name
// * @param attrName
// * @param handler
// * if null, system default mechanism will be used.
// * @return DialogField
// */
// public abstract DialogField createDialogFieldWithWrapper(String uri,
// String tagName, String attrName, IBindingHandler handler);
/**
* Create a cell editor.
*
* @param parent
* @param attr
* @param element
* @return CellEditor
*/
public abstract CellEditor createCellEditor(Composite parent,
IAttributeDescriptor attr, IDOMElement element);
/**
* Create a cell editor that will have databinding support.
*
* @param parent
* @param attr
* @param element
* @param handler
* if null, system default mechanism will be used.
* @return CellEditor
*/
public abstract CellEditor createCellEditorWithWrapper(Composite parent,
IAttributeDescriptor attr, IDOMElement element,
IBindingHandler handler);
/**
* Create a cell edtior that will have databinding support. This method
* don't provide an attribute descriptor, but it provide a CellEditorHolder
* to create whatever normal cell editor it wants.
*
* @param parent
* @param attr
* could be null
* @param holder
* @param element
* @param handler
* if null, system default mechanism will be used.
* @return CellEditor
*/
public abstract CellEditor createCellEditorWithWrapper(Composite parent,
IAttributeDescriptor attr, CellEditorHolder holder,
IDOMElement element, IBindingHandler handler);
/**
* @return the singleton instance
*/
public static XXXEditorCreator getInstance() {
if (_instance == null) {
_instance = new XXXDefaultEditorCreator();
}
return _instance;
}
/**
* @return the binding handler
*/
public IBindingHandler getSystemDefaultBindingHandler() {
return _defaultHandler;
}
}