configtool/com.nokia.S60CT.CenRep.edit/src/s60cenrep/provider/SimpleKeyItemProvider.java
author terytkon
Thu, 11 Mar 2010 18:39:02 +0200
changeset 0 30eb2d538f02
permissions -rw-r--r--
Moved all configtools under oss repository and under epl licence.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     1
/*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     3
* All rights reserved.
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     4
* This component and the accompanying materials are made available
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     6
* which accompanies this distribution, and is available
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     8
*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
     9
* Initial Contributors:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    11
*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    12
* Contributors:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    13
*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    14
* Description:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    15
*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    16
*/
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    17
package s60cenrep.provider;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    18
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    19
import interfaces.CellModifier;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    20
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    21
import java.util.ArrayList;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    22
import java.util.Collection;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    23
import java.util.List;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    24
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    25
import org.eclipse.emf.common.command.Command;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    26
import org.eclipse.emf.common.notify.AdapterFactory;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    27
import org.eclipse.emf.common.notify.Notification;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    28
import org.eclipse.emf.ecore.EObject;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    29
import org.eclipse.emf.ecore.EStructuralFeature;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    30
import org.eclipse.emf.edit.command.SetCommand;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    31
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    32
import org.eclipse.emf.edit.domain.EditingDomain;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    33
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    34
import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    35
import org.eclipse.emf.edit.provider.ViewerNotification;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    36
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    37
import cenrep.CenrepPackage;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    38
import cenrep.Key;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    39
import cenrep.Repository;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    40
import cenrep.TYPE;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    41
import cenrep.provider.KeyItemProvider;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    42
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    43
public class SimpleKeyItemProvider extends KeyItemProvider 
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    44
	implements ITableItemLabelProvider, CellModifier{
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    45
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    46
	public static final String PROP_NAME = "name";
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    47
	public static final String PROP_TYPE = "type";
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    48
	public static final String PROP_UID = "uid";
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    49
	public static final String PROP_REF = "ref";
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    50
	
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    51
	public static final EStructuralFeature NAME_FEATURE = CenrepPackage.eINSTANCE.getKey_Name();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    52
	public static final EStructuralFeature REF_FEATURE = CenrepPackage.eINSTANCE.getRVG_Ref();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    53
	public static final EStructuralFeature UID_FEATURE = CenrepPackage.eINSTANCE.getKey_ShortIdent();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    54
	//public static final EStructuralFeature STR_TYPE_FEATURE = CenrepPackage.eINSTANCE.getKey_StrType();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    55
	public static final EStructuralFeature TYPE_FEATURE = CenrepPackage.eINSTANCE.getKey_Type();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    56
	
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    57
	
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    58
	public SimpleKeyItemProvider(AdapterFactory adapterFactory) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    59
		super(adapterFactory);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    60
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    61
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    62
	@Override
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    63
	public Collection getChildrenFeatures(Object object) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    64
		if(childrenFeatures==null){ 
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    65
			childrenFeatures = new ArrayList<EStructuralFeature>();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    66
			childrenFeatures.add(CenrepPackage.Literals.REPOSITORY__SIMPLE_KEYS);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    67
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    68
		return childrenFeatures;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    69
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    70
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    71
	public Object getColumnImage(Object object, int columnIndex) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    72
		if(columnIndex==0)return getImage(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    73
		return null;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    74
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    75
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    76
	public String getColumnText(Object object, int columnIndex) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    77
		Key key = (Key)object;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    78
		switch(columnIndex){
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    79
		case 0:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    80
			return key.getName();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    81
		case 1:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    82
			return key.getRef();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    83
		case 2:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    84
			return key.getShortIdent();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    85
		case 3:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    86
			return key.getType().getName();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    87
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    88
		return null;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    89
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    90
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    91
	public boolean canModify(Object element, String property) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    92
		if (property.equals(PROP_NAME) || property.equals(PROP_REF) || property.equals(PROP_TYPE) || property.equals(PROP_UID))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    93
			return true;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    94
		else 
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    95
			return false;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    96
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    97
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    98
	public Object getValue(Object element, String property) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
    99
		EObject key = (EObject)element;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   100
		Object result = null;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   101
		if(property.equals(PROP_NAME))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   102
			result=(String)key.eGet(NAME_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   103
		else if(property.equals(PROP_REF))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   104
			result = (String) key.eGet(REF_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   105
		else if(property.equals(PROP_TYPE))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   106
			result = Integer.valueOf(((TYPE)key.eGet(TYPE_FEATURE)).getValue());
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   107
		else if(property.equals(PROP_UID))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   108
			result = (String) key.eGet(UID_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   109
		return result!=null?result:"";
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   110
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   111
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   112
	public void modify(Object parent,Object element, String property, Object value) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   113
		Command command=null;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   114
		EObject eObject=(EObject)element;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   115
		EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   116
		if(property.equals(PROP_NAME)){
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   117
			String oldName = (String) eObject.eGet(NAME_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   118
			String newName = (String) value;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   119
			if(oldName==null || !oldName.equals(newName))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   120
				command = SetCommand.create(domain, eObject, NAME_FEATURE, newName);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   121
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   122
		else if(property.equals(PROP_REF)){
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   123
			String oldRef = (String) eObject.eGet(REF_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   124
			String newRef = (String) value;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   125
			if(oldRef==null || !oldRef.equals(newRef))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   126
				command = SetCommand.create(domain, eObject, REF_FEATURE, newRef);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   127
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   128
		else if(property.equals(PROP_UID)){
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   129
			String oldUid = (String) eObject.eGet(UID_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   130
			String newUid = (String) value;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   131
			if (newUid.startsWith("0x") || newUid.startsWith("0X"))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   132
				newUid = "0x"+newUid.substring(2).toUpperCase();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   133
			else
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   134
				newUid = "0x"+newUid.toUpperCase();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   135
			if(oldUid==null || !oldUid.equals(newUid))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   136
				command = SetCommand.create(domain, eObject, UID_FEATURE, newUid);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   137
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   138
		else if(property.equals(PROP_TYPE)){
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   139
			TYPE oldType = (TYPE) eObject.eGet(TYPE_FEATURE);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   140
			TYPE newType = TYPE.get(((Integer)value).intValue());
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   141
			if(oldType==null || !oldType.equals(newType))
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   142
				command = SetCommand.create(domain, eObject, TYPE_FEATURE, newType);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   143
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   144
		if(command!=null)
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   145
			domain.getCommandStack().execute(command);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   146
		
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   147
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   148
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   149
	@Override
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   150
	public List getPropertyDescriptors(Object object) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   151
		if (itemPropertyDescriptors == null) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   152
			itemPropertyDescriptors = new ArrayList<IItemPropertyDescriptor>();
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   153
			addBackupPropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   154
			addReadOnlyPropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   155
			addNamePropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   156
			addRefPropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   157
			addShortIdentPropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   158
			addTypePropertyDescriptor(object);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   159
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   160
		return itemPropertyDescriptors;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   161
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   162
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   163
/*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   164
 
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   165
	@Override
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   166
	protected void addNamePropertyDescriptor(Object object) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   167
		itemPropertyDescriptors.add
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   168
		(createItemPropertyDescriptor
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   169
			(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   170
			 getResourceLocator(),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   171
			 getString("_UI_Key_name_feature"),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   172
			 getString("_UI_PropertyDescriptor_description", "_UI_Key_name_feature", "_UI_Key_type"),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   173
			 CenrepPackage.Literals.KEY__NAME,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   174
			 true,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   175
			 false,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   176
			 false,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   177
			 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   178
			 "UidName",
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   179
			 null));
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   180
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   181
*/
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   182
/*
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   183
	protected void addRefPropertyDescriptor(Object object) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   184
		itemPropertyDescriptors.add
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   185
			(createItemPropertyDescriptor
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   186
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   187
				 getResourceLocator(),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   188
				 getString("_UI_RVG_ref_feature"),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   189
				 getString("_UI_PropertyDescriptor_description", "_UI_RVG_ref_feature", "_UI_RVG_type"),
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   190
				 CenrepPackage.Literals.RVG__REF,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   191
				 true,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   192
				 false,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   193
				 false,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   194
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   195
				 "Setting",
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   196
				 null));
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   197
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   198
*/
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   199
	public void notifyChanged(Notification notification) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   200
		switch (notification.getFeatureID(Repository.class)) {
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   201
		case CenrepPackage.REPOSITORY__KEY:
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   202
			fireNotifyChanged(new ViewerNotification(notification, notification
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   203
					.getNotifier(), true, true));
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   204
			return;
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   205
		}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   206
		super.notifyChanged(notification);
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   207
	}
30eb2d538f02 Moved all configtools under oss repository and under epl licence.
terytkon
parents:
diff changeset
   208
}