1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Eclipse Public License, Version 1.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.eclipse.org/org/documents/epl-v10.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.ide.common.layout; 17 18 import com.android.ide.common.api.IDragElement.IDragAttribute; 19 import com.android.ide.common.api.INode.IAttribute; 20 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode; 21 22 /** Test/mock implementation of {@link IAttribute} and {@link IDragAttribute} */ 23 public class TestAttribute implements IAttribute, IDragAttribute { 24 private String mUri; 25 26 private String mName; 27 28 private String mValue; 29 TestAttribute(String mUri, String mName, String mValue)30 public TestAttribute(String mUri, String mName, String mValue) { 31 super(); 32 this.mName = mName; 33 this.mUri = mUri; 34 this.mValue = mValue; 35 } 36 getName()37 public String getName() { 38 return mName; 39 } 40 getUri()41 public String getUri() { 42 return mUri; 43 } 44 getValue()45 public String getValue() { 46 return mValue; 47 } 48 49 @Override toString()50 public String toString() { 51 return "TestAttribute [name=" + mName + ", uri=" + mUri + ", value=" + mValue + "]"; 52 } 53 compareTo(IDragAttribute o)54 public int compareTo(IDragAttribute o) { 55 return UiAttributeNode.compareAttributes(mName, o.getName()); 56 } 57 }