Author: Grid.Qian
Date: 2010-03-19 03:25:42 -0400 (Fri, 19 Mar 2010)
New Revision: 20923
Removed:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseField.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboBoxField.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/CompositeEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/IFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/INamedElement.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ITaggedFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/LabelFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextField.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextFieldEditor.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimePreferencePage.java
trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
Log:
JBIDE-6034: remove the ws preference page editor codes and reuse them from common.ui
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-03-19 07:22:31 UTC
(rev 20922)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-03-19 07:25:42 UTC
(rev 20923)
@@ -16,7 +16,8 @@
org.eclipse.jem.util,
org.jboss.tools.ws.creation.core,
org.eclipse.wst.common.frameworks,
- org.eclipse.wst.common.emfworkbench.integration
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.jboss.tools.common.ui
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.ws.ui,
org.jboss.tools.ws.ui.messages,
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseField.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseField.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseField.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author Grid Qian
- */
-public abstract class BaseField {
-
- public static final String PROPERTY_NAME = "value"; //$NON-NLS-1$
-
- private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- pcs.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- pcs.removePropertyChangeListener(listener);
- }
-
- public void firePropertyChange(Object oldValue, Object newValue) {
- pcs.firePropertyChange(PROPERTY_NAME, oldValue, newValue);
- }
-
- abstract public Control getControl();
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/BaseFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-
-/**
- * @author Grid Qian
- */
-public abstract class BaseFieldEditor implements IFieldEditor {
-
- PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
- Set<DisposeListener> disposeListeners = new HashSet<DisposeListener>();
-
- private Object value = new Object();
-
- private String labelText;
-
- private String nameText = null;
-
- Label labelControl = null;
-
- protected Map<Object, Object> data = null;
-
- private boolean enabled = true;
-
- /**
- *
- * @param name
- * @param label
- * @param defaultValue
- */
- public BaseFieldEditor(String name, String label,Object defaultValue) {
- this.value = defaultValue;
- this.labelText = label;
- this.nameText = name;
- }
-
- /**
- *
- * @param parent
- */
- public void doFillIntoGrid(Object parent) {
- Assert.isTrue(parent instanceof Composite,
JBossWSUIMessages.Error_JBossWS_Basic_Editor_Composite);
- Assert.isTrue(((Composite)parent).getLayout() instanceof
GridLayout,JBossWSUIMessages.Error_JBossWS_Basic_Editor_Support);
- Composite aComposite = (Composite) parent;
- final Control[] controls = (Control[])getEditorControls(aComposite);
- GridLayout gl = (GridLayout)((Composite)parent).getLayout();
-
- doFillIntoGrid(aComposite,gl.numColumns);
- if(controls.length>0) {
- controls[0].addDisposeListener(new DisposeListener(){
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- controls[0].removeDisposeListener(this);
- }
- });
- }
- }
-
- /**
- * @param composite
- * @param numColumns
- */
- protected void doFillIntoGrid(Composite composite, int numColumns) {
-
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- pcs.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- pcs.removePropertyChangeListener(listener);
- }
-
- /**
- *
- * @param parent
- * @return
- */
- public Label createLabelControl(Composite parent) {
- if(labelControl==null) {
- labelControl = new Label(parent,SWT.NO_BACKGROUND);
- labelControl.setText(this.labelText);
- } else if(parent!=null) {
- if(labelControl.getParent()!=parent)
- throw new
IllegalArgumentException(JBossWSUIMessages.Error_JBossWS_Basic_Editor_Different);
- }
- return labelControl;
- }
-
- public Label getLabelControl() {
- return createLabelControl(null);
- }
-
- public abstract Object[] getEditorControls(Object composite);
-
- public abstract Object[] getEditorControls();
-
- public Control[] getSwtControls() {
- return (Control[])getEditorControls();
- }
-
- public abstract int getNumberOfControls();
-
- public Object getValue() {
- return value;
- }
-
- public String getValueAsString() {
- return getValue().toString();
- }
-
- public boolean isEnabled() {
- return this.enabled ;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- Control[] controls = getSwtControls();
- if(controls==null) {
- return;
- }
- for(int i=0;i<controls.length;i++) {
- Control control = controls[i];
- control.setEnabled(enabled);
- if(control instanceof Composite) {
- setEnabled((Composite)control, enabled);
- }
- }
- }
-
- private void setEnabled(Composite composite, boolean enabled) {
- Control[] controls = composite.getChildren();
- for(int i=0;i<controls.length;i++) {
- Control control = controls[i];
- control.setEnabled(enabled);
- if(control instanceof Composite) {
- setEnabled((Composite)control, enabled);
- }
- }
- }
-
- public boolean setFocus() {
- return true;
- }
-
- /**
- *
- * @param newValue
- */
- public void setValue(Object newValue) {
- Object oldValue = value;
- value = newValue;
- pcs.firePropertyChange(nameText,oldValue,newValue);
- }
-
- public void setValueAsString(String stringValue) {
- value = stringValue;
- }
-
- public String getName() {
- return nameText;
- }
-
- public void dispose() {
- PropertyChangeListener[] listeners = pcs.getPropertyChangeListeners();
- for (int i = 0; i < listeners.length; i++) {
- PropertyChangeListener propertyChangeListener = listeners[i];
- pcs.removePropertyChangeListener(propertyChangeListener);
- }
- }
-
- public void dispose(DisposeEvent e) {
- dispose();
- for (DisposeListener disposeListener : disposeListeners) {
- disposeListener.widgetDisposed(e);
- }
- disposeListeners.clear();
- }
-
- public void addDisposeListener(DisposeListener listener) {
- disposeListeners.add(listener);
- }
-
- public void removeDisposeListener(DisposeListener listener) {
- disposeListeners.remove(listener);
- }
-
- public String getLabelText() {
- return labelText;
- }
-
- /**
- *
- * @param labelText
- */
- public void setLabelText(String labelText) {
- this.labelText = labelText;
- }
-
- private boolean editable = true;
-
- public boolean isEditable() {
- return editable;
- }
-
- public void setEditable(boolean aEditable) {
- this.editable = aEditable;
- }
-
- public Object getData(Object key) {
- if(data==null) {
- return null;
- }
- return data.get(key);
- }
-
- public void setData(Object key, Object value) {
- if(data==null) {
- data = new HashMap<Object, Object>();
- }
- data.put(key, value);
- }
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-
-/**
- * @author Grid Qian
- */
-public class ButtonFieldEditor extends BaseFieldEditor {
-
- PushButtonField button= null;
- int style;
-
- private ButtonPressedAction buttonAction = new
ButtonPressedAction(JBossWSUIMessages.JBossWS_Button_Field_Editor_Browse) {
- @Override
- public void run() {
- throw new
RuntimeException(JBossWSUIMessages.Error_JBossWS_Button_Field_Editor_Not_Implemented_Yet);
- }
- };
-
- public ButtonFieldEditor(String name, String label, int style) {
- super(name, label, new Object());
- this.style = style;
- }
-
- public ButtonFieldEditor(String name, ButtonPressedAction action, Object defaultValue)
{
- super(name, action.getText(), defaultValue);
- buttonAction = action;
- buttonAction.setFieldEditor(this);
- }
-
- @Override
- public void doFillIntoGrid(Object parent) {
- }
-
- @Override
- public Object[] getEditorControls() {
- if(button==null) {
- return null;
- }
- return new Control[]{button.getControl()};
- }
-
- @Override
- public boolean isEditable() {
- return false;
- }
-
- public void save(Object object) {
- }
-
- @Override
- public void setEditable(boolean ediatble) {
- }
-
- @Override
- public Object[] getEditorControls(Object composite) {
- if(button==null && composite!=null) {
- button = new PushButtonField((Composite)composite, style, buttonAction);
- setEnabled(isEnabled());
- }
- return new Control[]{button.getControl()};
- }
-
- public ButtonPressedAction getButtonaction() {
- return buttonAction;
- }
-
- public static class ButtonPressedAction extends Action implements SelectionListener{
-
- private IFieldEditor editor = null;
-
- public ButtonPressedAction(String label) {
- super(label);
- }
-
- public void setFieldEditor(IFieldEditor newEditor) {
- editor = newEditor;
- }
-
- public IFieldEditor getFieldEditor() {
- return editor;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- run();
- }
- }
-
- @Override
- public int getNumberOfControls() {
- return 1;
- }
-}
\ No newline at end of file
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboBoxField.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboBoxField.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboBoxField.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author Grid.Qian
- *
- */
-public class ComboBoxField extends BaseField implements ISelectionChangedListener {
-
- ComboViewer comboControl = null;
- List<String> values = new ArrayList<String>();
-
- public ComboBoxField(Composite parent,List<String> values, ILabelProvider
labelProvider,
- Object value, boolean flatStyle) {
- this(parent, values, value, flatStyle);
- comboControl.setLabelProvider(labelProvider);
- }
-
- public ComboBoxField(Composite parent,List<String> values, Object value, boolean
editable) {
- this.values = values;
- /*
- * Used combo box instead of custom combobox(CCombo),
- * CCombo looks ugly under MAC OS X
- */
- Combo combo;
- if(editable==true) {
-
- combo = new Combo(parent, SWT.DROP_DOWN);
- } else {
- combo = new Combo(parent, SWT.READ_ONLY);
- }
- combo.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
- comboControl = new ComboViewer(combo);
- comboControl.setContentProvider(new IStructuredContentProvider() {
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
- }
-
- public Object[] getElements(Object inputElement) {
- return ComboBoxField.this.values.toArray();
- }
- });
-
- comboControl.addSelectionChangedListener(this);
- comboControl.getCombo().addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- firePropertyChange(new Object(), comboControl.getCombo().getText());
- }});
- comboControl.setLabelProvider(new ILabelProvider() {
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return element.toString();
- }
- });
- comboControl.setInput(values);
- comboControl.setSelection(new StructuredSelection(value), true);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- firePropertyChange("",
((StructuredSelection)event.getSelection()).getFirstElement()); //$NON-NLS-1$
- }
-
- public Combo getComboControl() {
- return comboControl.getCombo();
- }
-
- @Override
- public Control getControl() {
- return getComboControl();
- }
-
- public void setValue(Object newValue) {
- comboControl.setSelection(new StructuredSelection(newValue));
- comboControl.getCombo().setText(newValue.toString());
- }
-
- public void setTags(String[] tags,String value) {
- values = Arrays.asList(tags);
- comboControl.removeSelectionChangedListener(this);
- comboControl.refresh(true);
- comboControl.addPostSelectionChangedListener(this);
- comboControl.setSelection(new StructuredSelection(value));
- }
- /*
- * We can't modify combo, change style of this object,
- * if we such functionality please use CCombo
- *
- */
- public void setEditable(
- boolean ediatble) {
- //comboControl.getCCombo().setEditable(false);
- }
-}
\ No newline at end of file
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ComboFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author Grid Qian
- */
-public class ComboFieldEditor extends BaseFieldEditor implements
ITaggedFieldEditor,PropertyChangeListener{
-
- List<String> values = null;
-
- boolean editable = false;
-
- public ComboFieldEditor(String name, String label, List<String> values,Object
defaultValue,boolean editableSelection) {
- super(name, label, defaultValue);
- this.values = Collections.unmodifiableList(values);
- this.editable = editableSelection;
- }
-
- private ComboBoxField comboField;
-
- @Override
- public Object[] getEditorControls(Object composite) {
- return new Control[] {getComboControl((Composite)composite)};
- }
-
- @Override
- public void doFillIntoGrid(Object parent) {
- }
-
- public Control getComboControl(Composite composite) {
- if(comboField == null) {
- comboField = new ComboBoxField(composite,values,getValue(),editable);
- comboField.addPropertyChangeListener(this);
- final Combo combo =comboField.getComboControl();
- combo.addDisposeListener(new DisposeListener(){
- public void widgetDisposed(DisposeEvent e) {
- dispose(e);
- combo.removeDisposeListener(this);
- }
- });
- } else if(composite!=null) {
- Assert.isTrue(comboField.getControl().getParent()==composite);
- }
- return comboField.getControl();
- }
-
- @Override
- public Object[] getEditorControls() {
- return new Control[]{comboField.getControl()};
- }
-
- public void save(Object object) {
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- setValue(evt.getNewValue());
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#getTags()
- */
- public String[] getTags() {
- return comboField.getComboControl().getItems();
- }
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#setTags(java.lang.String[])
- */
- public void setTags(String[] tags) {
- comboField.setTags(tags,getValueAsString());
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.seam.ui.widget.editor.BaseFieldEditor#getNumberOfControls()
- */
- @Override
- public int getNumberOfControls() {
- return 1;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.ui.widget.editor.CompositeEditor#setEditable(boolean)
- */
- @Override
- public void setEditable(boolean ediatble) {
- super.setEditable(ediatble);
- comboField.setEditable(ediatble);
- }
-
- public void setValue(Object newValue) {
- if(newValue==null) {
- return;
- }
- super.setValue(newValue);
- if(comboField!=null) {
- comboField.removePropertyChangeListener(this);
- comboField.setValue(newValue.toString());
- comboField.addPropertyChangeListener(this);
- }
- }
-}
\ No newline at end of file
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/CompositeEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/CompositeEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/CompositeEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-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.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-
-/**
- * @author Grid Qian
- */
-public class CompositeEditor extends BaseFieldEditor implements PropertyChangeListener {
-
- public CompositeEditor(String name, String label, Object defaultValue) {
- super(name, label, defaultValue);
- }
-
- @Override
- public void doFillIntoGrid(Object parent) {
- Assert.isTrue(parent instanceof Composite,
- JBossWSUIMessages.Error_JBossWS_Basic_Editor_Composite);
- Assert.isTrue(((Composite) parent).getLayout() instanceof GridLayout,
- JBossWSUIMessages.Error_JBossWS_Basic_Editor_Support);
-
- Composite aComposite = (Composite) parent;
- final Control[] controls = (Control[]) getEditorControls(aComposite);
- GridLayout gl = (GridLayout) ((Composite) parent).getLayout();
-
- for (int i = 0; i < controls.length; i++) {
- GridData gd = new GridData();
- gd.horizontalSpan = i == 1 ? gl.numColumns - controls.length + 1 : 1;
- if (controls[i] instanceof Combo && i == (controls.length - 1)) {
- gd.horizontalAlignment = SWT.BEGINNING;
- } else {
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = (i == 1);
- }
-
- controls[i].setLayoutData(gd);
- controls[i].setEnabled(isEnabled());
-
- if(i==0) {
- controls[i].addDisposeListener(new DisposeListener(){
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- controls[0].removeDisposeListener(this);
- }
- });
- }
- }
- }
-
- List<Control> controls = new ArrayList<Control>();
-
- @Override
- public Object[] getEditorControls() {
- if(controls.size()>0) return controls.toArray();
- else throw new
IllegalStateException(JBossWSUIMessages.JBossWS_Composite_Editor_This_Method_Can_Be_Invoked);
- }
-
- @Override
- public Object[] getEditorControls(Object parent) {
- for (IFieldEditor editor : editors) {
- controls.addAll(Arrays.asList((Control[])editor.getEditorControls(parent)));
- }
- return controls.toArray(new Control[]{});
- }
-
- @Override
- public int getNumberOfControls() {
- return editors.size();
- }
-
- @Override
- public boolean isEditable() {
- return true;
- }
-
- public void save(Object object) {
- }
-
- @Override
- public void setEditable(boolean ediatble) {
- }
-
- List<IFieldEditor> editors = new ArrayList<IFieldEditor>();
-
- public CompositeEditor addFieldEditors(IFieldEditor[] editors) {
- this.editors.addAll( Arrays.asList(editors));
- for (IFieldEditor editor : Arrays.asList(editors)) {
- editor.addPropertyChangeListener(this);
- }
- return this;
- }
-
- @Override
- public void setValue(Object newValue) {
- for (IFieldEditor editor : editors) {
- editor.removePropertyChangeListener(this);
- editor.setValue(newValue);
- editor.addPropertyChangeListener(this);
- }
- super.setValue(newValue);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- for (IFieldEditor editor : editors) {
- if(event.getSource()!=editor) {
- editor.removePropertyChangeListener(this);
- editor.setValue(event.getNewValue());
- editor.addPropertyChangeListener(this);
- }
- }
- super.setValue(event.getNewValue());
- }
-
- @Override
- public void setEnabled(boolean set) {
- for (IFieldEditor editor : editors) {
- editor.setEnabled(set);
- }
- }
-
- public List<IFieldEditor> getEditors() {
- return Collections.unmodifiableList(editors);
- }
-
- public IFieldEditor getEditorByName(String name) {
- for (IFieldEditor editor : editors) {
- if(name.equals(editor.getName())) {
- return editor;
- }
- }
- return null;
- }
-
- public void setData(Object key, Object value) {
- super.setData(key, value);
- for (IFieldEditor editor : editors) {
- editor.setData(key, value);
- }
- }
-}
\ No newline at end of file
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/IFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/IFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/IFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeListener;
-
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-
-/**
- * @author Grid Qian
- */
-public interface IFieldEditor extends INamedElement {
-
- /**
- *
- * @param composite
- */
- public Object[] getEditorControls(Object composite);
-
- public Object[] getEditorControls();
-
- public int getNumberOfControls();
-
- /**
- *
- * @param parent
- */
- public void doFillIntoGrid(Object parent);
-
- /**
- *
- * @param listener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- *
- * @param listener
- */
- public void addDisposeListener(DisposeListener listener);
-
- /**
- *
- * @param listener
- */
- public void removeDisposeListener(DisposeListener listener);
-
- /**
- *
- * @param listener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener);
-
- public boolean isEditable();
-
- /**
- *
- * @param aEdiatble
- */
- public void setEditable(boolean aEdiatble);
-
- public boolean setFocus();
-
- public boolean isEnabled();
-
- /**
- *
- * @param enabled
- */
- public void setEnabled(boolean enabled);
-
- public void dispose();
-
- /**
- *
- * @param e
- */
- public void dispose(DisposeEvent e);
-
- /**
- * Sets the application defined property of this editor
- *
- * @param data
- * @param key
- */
- public void setData(Object key, Object data);
-
- /**
- * Gets the application defined property of this editor
- *
- * @param key
- * @return
- */
- public Object getData(Object key);
-
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/INamedElement.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/INamedElement.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/INamedElement.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-/**
- * @author Grid Qian
- */
-public interface INamedElement {
-
- public abstract String getName();
-
- public abstract Object getValue();
-
- public abstract void setValue(Object newValue);
-
- public abstract String getValueAsString();
-
- public abstract void setValueAsString(String aValue);
-
-}
\ No newline at end of file
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ITaggedFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ITaggedFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ITaggedFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.preferences;
-
-public interface ITaggedFieldEditor extends IFieldEditor {
-
- /**
- *
- * @return
- */
- public String[] getTags();
-
- /**
- *
- * @param tags
- */
- public void setTags(String[] tags);
-}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -58,6 +58,10 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.common.ui.widget.editor.BaseFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.ButtonFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
import org.jboss.tools.ws.ui.utils.UIUtils;
import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
@@ -220,7 +224,7 @@
return ((List<JBossWSRuntime>) inputElement).toArray();
} else {
throw new IllegalArgumentException(
- JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be_An_Instance_Of_List);
+ JBossWSUIMessages.Error_JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be_An_Instance_Of_List);
}
}
@@ -340,7 +344,6 @@
List<JBossWSRuntime> runtimes = (List<JBossWSRuntime>) getValue();
boolean checked = false;
for (JBossWSRuntime jbossWSRuntime : runtimes) {
-
if (checkedElement == jbossWSRuntime) {
checked = true;
tableView.setChecked(checkedElement, true);
@@ -417,13 +420,13 @@
List<JBossWSRuntime> value = null;
- IFieldEditor name = createTextEditor(SRT_NAME,
+ IFieldEditor name = IFieldEditorFactory.INSTANCE.createTextEditor(SRT_NAME,
JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Name2, "");
//$NON-NLS-1$
- IFieldEditor version = createComboEditor(SRT_VERSION,
- JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Version,getESBFacetVersions(),
""); //$NON-NLS-1$
+ IFieldEditor version = IFieldEditorFactory.INSTANCE.createComboEditor(SRT_VERSION,
+ JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Version,getWSFacetVersions(),
""); //$NON-NLS-1$
- IFieldEditor homeDir = createBrowseFolderEditor(
+ IFieldEditor homeDir = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
SRT_HOMEDIR,
JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Home_Folder,
""); //$NON-NLS-1$
@@ -547,7 +550,7 @@
}
if (!runtimeExist(homeDir.getValueAsString())) {
- setErrorMessage(JBossWSUIMessages.Label_JBossWS_Runtime_Load_Error);
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_Label_Runtime_Load);
setPageComplete(false);
return;
}
@@ -570,10 +573,10 @@
/*
* get facet version.
*/
- private List<String> getESBFacetVersions(){
+ private List<String> getWSFacetVersions(){
List<String> versions = new ArrayList<String>();
- IProjectFacet esbfacet =
ProjectFacetsManager.getProjectFacet("jbossws.core"); //$NON-NLS-1$
- for(IProjectFacetVersion version: esbfacet.getVersions()){
+ IProjectFacet wsFacet =
ProjectFacetsManager.getProjectFacet("jbossws.core"); //$NON-NLS-1$
+ for(IProjectFacetVersion version: wsFacet.getVersions()){
versions.add(version.getVersionString());
}
@@ -596,41 +599,6 @@
return newRt;
}
- public IFieldEditor createTextEditor(String name, String label,
- String defaultValue) {
- CompositeEditor editor = new CompositeEditor(name, label,
- defaultValue);
- editor.addFieldEditors(new IFieldEditor[] {
- new LabelFieldEditor(name, label),
- new TextFieldEditor(name, label, defaultValue) });
- return editor;
- }
-
- public IFieldEditor createBrowseFolderEditor(String name, String label,
- String defaultValue) {
- CompositeEditor editor = new CompositeEditor(name, label,
- defaultValue);
- editor
- .addFieldEditors(new IFieldEditor[] {
- new LabelFieldEditor(name, label),
- new TextFieldEditor(name, label, defaultValue),
- new ButtonFieldEditor(
- name,
- createSelectFolderAction(JBossWSUIMessages.JBossWS_SWT_Field_Editor_Factory_Browse),
- defaultValue) });
- return editor;
- }
-
- public IFieldEditor createComboEditor(String name, String label,
- List<String> values, String defaultValue) {
- CompositeEditor editor = new CompositeEditor(name, label,
- defaultValue);
- editor.addFieldEditors(new IFieldEditor[] {
- new LabelFieldEditor(name, label),
- new ComboFieldEditor(name, label, values, defaultValue, false) });
- return editor;
- }
-
public ButtonFieldEditor.ButtonPressedAction createSelectFolderAction(
String buttonName) {
return new ButtonFieldEditor.ButtonPressedAction(buttonName) {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -48,6 +48,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.common.ui.widget.editor.BaseFieldEditor;
import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
import org.jboss.tools.ws.ui.JBossWSUIPlugin;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
@@ -137,7 +138,7 @@
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;
- jarGroup.setVisible(false);
+ jarGroup.setVisible(tempJbws.isUserConfigClasspath());
jarGroup.setLayoutData(gd);
jarGroup.setLayout(new FormLayout());
@@ -206,7 +207,7 @@
.toArray();
} else {
throw new IllegalArgumentException(
- JBossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be_An_Instance_Of_List);
+ JBossWSUIMessages.Error_JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be_An_Instance_Of_List);
}
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimePreferencePage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimePreferencePage.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimePreferencePage.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -45,8 +45,6 @@
/**
* Create contents of JBossWS preferences page. JBossWSRuntime list editor
* is created
- *
- * @return Control
*/
@Override
protected Control createContents(Composite parent) {
@@ -60,10 +58,6 @@
/**
* Inherited from IWorkbenchPreferencePage
- *
- * @param workbench
- * {@link IWorkbench}
- *
*/
public void init(IWorkbench workbench) {
}
@@ -83,15 +77,17 @@
jbossWSRuntimes.getRemoved().clear();
JBossWSRuntime defaultRuntime = jbossWSRuntimes
.getDefaultJBossWSRuntime();
+
// reset default runtime
for (JBossWSRuntime jbossWSRuntime : JBossWSRuntimeManager
.getInstance().getRuntimes()) {
jbossWSRuntime.setDefault(false);
}
- // set deafult runtime
+ // set default runtime
if (defaultRuntime != null) {
defaultRuntime.setDefault(true);
}
+
jbossWSRuntimes.setDefaultJBossWSRuntime(null);
Map<JBossWSRuntime, JBossWSRuntime> changed = jbossWSRuntimes
.getChangedJBossWSRuntimes();
@@ -126,8 +122,6 @@
/**
* See {@link PreferencePage} for details
- *
- * @return Boolean
*/
@Override
public boolean performOk() {
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/LabelFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/LabelFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/LabelFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author Grid Qian
- */
-public class LabelFieldEditor extends BaseFieldEditor {
-
- public LabelFieldEditor(String name, String label) {
- super(name, label, ""); //$NON-NLS-1$
- }
-
- @Override
- public void doFillIntoGrid(Object parent) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Object[] getEditorControls(Object composite) {
- // TODO Auto-generated method stub
- return new Control[]{createLabelControl((Composite)composite)};
- }
-
- @Override
- public Object[] getEditorControls() {
- return getEditorControls(null);
- }
-
- @Override
- public boolean isEditable() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void save(Object object) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setEditable(boolean ediatble) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setValue(Object value) {
- }
-
- @Override
- public int getNumberOfControls() {
- // TODO Auto-generated method stub
- return 1;
- }
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.ws.ui.preferences.ButtonFieldEditor.ButtonPressedAction;
-
-/**
- * @author Grid Qian
- *
- */
-public class PushButtonField extends BaseField {
-
- Button button;
-
- /**
- *
- */
- @Override
- public Control getControl() {
- return button;
- }
-
-
- public PushButtonField(Composite composite, int style, ButtonPressedAction listener) {
- button = new Button(composite, style);
- button.setText(listener.getText());
- button.addSelectionListener(listener);
- }
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextField.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextField.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextField.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @author Grid Qian
- */
-public class TextField extends BaseField implements ModifyListener{
-
-
- Text textField = null;
-
- public TextField(Composite parent, int style) {
- textField = new Text(parent,style);
- textField.addModifyListener(this);
- }
-
- public void modifyText(ModifyEvent e) {
- firePropertyChange(new Object(),((Text)e.widget).getText().trim());
- }
-
- public Text getTextControl() {
- return textField;
- }
-
- public Control getControl() {
- return getTextControl();
- }
-}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextFieldEditor.java 2010-03-19
07:22:31 UTC (rev 20922)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/TextFieldEditor.java 2010-03-19
07:25:42 UTC (rev 20923)
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.ui.preferences;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-
-/**
- *
- * @author Grid Qian
- *
- */
-public class TextFieldEditor extends BaseFieldEditor implements PropertyChangeListener{
-
- public static final int UNLIMITED = -1;
-
- protected int style = -1;
-
- /**
- *
- * @param name
- * @param aLabelText
- * @param defaultvalue
- */
- public TextFieldEditor(String name,String aLabelText,String defaultvalue) {
- super(name, aLabelText, defaultvalue);
- }
-
- /**
- *
- * @param name
- * @param aLabelText
- * @param defaultvalue
- * @param editable
- */
- public TextFieldEditor(String name,String aLabelText,String defaultvalue,boolean
editable) {
- super(name, aLabelText, defaultvalue);
- setEditable(editable);
- }
-
- protected TextField fTextField = null;
-
- protected int fWidthInChars = 0;
-
- @Override
- public Object[] getEditorControls() {
- return new Control[] {getTextControl()};
- }
-
- @Override
- public void doFillIntoGrid(Object aParent) {
- Assert.isTrue(aParent instanceof Composite,
JBossWSUIMessages.Error_JBossWS_Basic_Editor_Composite);
- Assert.isTrue(((Composite)aParent).getLayout() instanceof
GridLayout,JBossWSUIMessages.Error_JBossWS_Basic_Editor_Support);
- Composite aComposite = (Composite) aParent;
- getEditorControls(aComposite);
- GridLayout gl = (GridLayout)((Composite)aParent).getLayout();
- getTextControl(aComposite);
-
- GridData gd = new GridData();
-
- gd.horizontalSpan = gl.numColumns - 1;
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
-
- fTextField.getTextControl().setLayoutData(gd);
- }
-
- /**
- *
- * @param parent
- * @return
- */
- public Text getTextControl(Composite parent) {
- if (fTextField == null) {
- fTextField = new TextField(parent, getInitialStyle());
- Text textField = fTextField.getTextControl();
- textField.setFont(parent.getFont());
- textField.setText(getValue().toString());
- textField.setEditable(isEditable());
- textField.setEnabled(isEnabled());
- fTextField.addPropertyChangeListener(this);
- } else if (parent!=null){
- Assert.isTrue(parent==fTextField.getTextControl().getParent());
- }
- return fTextField.getTextControl();
- }
-
- protected void updateWidgetValues() {
- setValueAsString(getValueAsString());
- }
-
- protected int getInitialStyle() {
- if(this.style >= 0) return style;
- return SWT.SINGLE | SWT.BORDER;
- }
-
- /*
- * @param value
- * @return
- */
- @SuppressWarnings({ "unchecked", "unused" })
- private String checkCollection(Object value){
-
- return value != null && (((Collection)value).size() > 0) ?
prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
- }
-
- /*
- * @param collection
- * @return
- */
- @SuppressWarnings("unchecked")
- private String prepareCollectionToString(Collection collection)
- {
- String stringValue = ""; //$NON-NLS-1$
- Object[] objects = collection.toArray();
- for(int i = 0; i < objects.length; i++){
- stringValue += objects[i];
- if(i < objects.length - 1)
- stringValue += " "; //$NON-NLS-1$
- }
- return stringValue;
- }
-
-
- /*
- * @param value
- * @return
- */
- @SuppressWarnings("unused")
- private String checkSimple(Object value){
- return (value != null) ? value.toString() : ""; //$NON-NLS-1$
- }
-
- @Override
- public int getNumberOfControls() {
- return 2;
- }
-
- /**
- * Returns this field editor's text control.
- *
- * @return the text control, or <code>null</code> if no
- * text field is created yet
- */
- protected Text getTextControl() {
- return fTextField!=null?fTextField.getTextControl():null;
- }
-
- @Override
- public boolean setFocus() {
- boolean setfocus = false;
- if(fTextField!=null && !fTextField.getTextControl().isDisposed())
- setfocus = fTextField.getTextControl().setFocus();
- return setfocus;
- }
-
- @Override
- public Object[] getEditorControls(Object composite) {
- return new Control[]{getTextControl((Composite)composite)};
- }
-
- /**
- *
- * @param object
- */
- public void save(Object object) {
- }
-
- /**
- *
- */
- @Override
- public void setValue(Object newValue) {
- super.setValue(newValue);
- if(fTextField!=null){
- fTextField.removePropertyChangeListener(this);
- fTextField.getTextControl().setText(newValue.toString());
- fTextField.addPropertyChangeListener(this);
- }
- }
-
- @Override
- public void setEditable(boolean aEditable) {
- super.setEditable(aEditable);
- if(getTextControl()!=null) getTextControl().setEditable(aEditable);
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- super.setValue(evt.getNewValue());
- }
-}
\ No newline at end of file
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2010-03-19 07:22:31 UTC
(rev 20922)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2010-03-19 07:25:42 UTC
(rev 20923)
@@ -9,7 +9,8 @@
org.junit,
org.jboss.tools.tests,
org.jboss.tools.ws.ui,
- org.jboss.tools.ws.core
+ org.jboss.tools.ws.core,
+ org.jboss.tools.common.ui
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin