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 37 @Override getName()38 public String getName() { 39 return mName; 40 } 41 42 @Override getUri()43 public String getUri() { 44 return mUri; 45 } 46 47 @Override getValue()48 public String getValue() { 49 return mValue; 50 } 51 52 @Override toString()53 public String toString() { 54 return "TestAttribute [name=" + mName + ", uri=" + mUri + ", value=" + mValue + "]"; 55 } 56 compareTo(IDragAttribute o)57 public int compareTo(IDragAttribute o) { 58 return UiAttributeNode.compareAttributes(mName, o.getName()); 59 } 60 }