KindSectionView.java revision f7ce5978a6a6314028fe9bbb1da99338b111750f
1aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey/* 2aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * Copyright (C) 2009 The Android Open Source Project 3aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * 4aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License"); 5aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * you may not use this file except in compliance with the License. 6aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * You may obtain a copy of the License at 7aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * 8aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * http://www.apache.org/licenses/LICENSE-2.0 9aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * 10aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * Unless required by applicable law or agreed to in writing, software 11aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS, 12aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * See the License for the specific language governing permissions and 14aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * limitations under the License. 15aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey */ 16aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 17afeae64e9a9bb39c918202a5775c4904e2f0d92eDaniel Lehmannpackage com.android.contacts.views.editor; 18aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 19aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport com.android.contacts.R; 2035769b804fbfd5a1fc0b2c36cd0a786d662c4334Daniel Lehmannimport com.android.contacts.model.BaseAccountType.DataKind; 21d25f958595b190586bd838d50718b1a2a3f0d417Dmitri Plotnikovimport com.android.contacts.model.EntityDelta; 22aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport com.android.contacts.model.EntityDelta.ValuesDelta; 23d25f958595b190586bd838d50718b1a2a3f0d417Dmitri Plotnikovimport com.android.contacts.model.EntityModifier; 24afeae64e9a9bb39c918202a5775c4904e2f0d92eDaniel Lehmannimport com.android.contacts.views.editor.Editor.EditorListener; 25aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 26aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.content.Context; 27aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.provider.ContactsContract.Data; 283e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmannimport android.text.TextUtils; 29aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.util.AttributeSet; 30aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.view.View; 31aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.view.ViewGroup; 328d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmannimport android.widget.ImageButton; 33aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.widget.LinearLayout; 34aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkeyimport android.widget.TextView; 35aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 36aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey/** 37aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * Custom view for an entire section of data as segmented by 38aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * {@link DataKind} around a {@link Data#MIMETYPE}. This view shows a 39aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * section header and a trigger for adding new {@link Data} rows. 40aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey */ 41bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmannpublic class KindSectionView extends LinearLayout implements EditorListener { 42aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey private static final String TAG = "KindSectionView"; 43aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 44aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey private ViewGroup mEditors; 458d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmann private ImageButton mAddPlusButton; 46aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey private TextView mTitle; 47f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann private String mTitleString; 48aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 49aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey private DataKind mKind; 50aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey private EntityDelta mState; 5192525ff51e2cb06531447a7dcde5e22334669c8eMegha Joshi private boolean mReadOnly; 526f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey 534b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki private ViewIdGenerator mViewIdGenerator; 544b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki 55aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey public KindSectionView(Context context) { 56aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey super(context); 57aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 58aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 59aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey public KindSectionView(Context context, AttributeSet attrs) { 60aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey super(context, attrs); 61aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 62aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 63aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey /** {@inheritDoc} */ 64aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey @Override 65aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey protected void onFinishInflate() { 66aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey setDrawingCacheEnabled(true); 67aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey setAlwaysDrawnWithCacheEnabled(true); 68aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 69aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey mEditors = (ViewGroup)findViewById(R.id.kind_editors); 70aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 718d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmann mAddPlusButton = (ImageButton) findViewById(R.id.kind_plus); 728d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmann mAddPlusButton.setOnClickListener(new OnClickListener() { 73bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann public void onClick(View v) { 74bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann addItem(); 75bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann } 76bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann }); 77aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 78aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey mTitle = (TextView)findViewById(R.id.kind_title); 79aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 80aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 816f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey /** {@inheritDoc} */ 82aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey public void onDeleted(Editor editor) { 83bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann updateAddEnabled(); 84bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann updateVisible(); 85aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 86aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 876f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey /** {@inheritDoc} */ 886f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey public void onRequest(int request) { 896f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey // Ignore requests 906f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey } 916f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey 924b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki public void setState(DataKind kind, EntityDelta state, boolean readOnly, ViewIdGenerator vig) { 93aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey mKind = kind; 94aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey mState = state; 9592525ff51e2cb06531447a7dcde5e22334669c8eMegha Joshi mReadOnly = readOnly; 964b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki mViewIdGenerator = vig; 974b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki 984b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki setId(mViewIdGenerator.getId(state, kind, null, ViewIdGenerator.NO_VIEW_INDEX)); 99aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 100aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey // TODO: handle resources from remote packages 101f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann mTitleString = (kind.titleRes == -1 || kind.titleRes == 0) 102f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann ? "" 103cfb525b3f18d71d6cc5d4ef36d704b3ba9e9a6f3Daniel Lehmann : getResources().getString(kind.titleRes); 104f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann mTitle.setText(mTitleString.toUpperCase()); 105aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 106da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann // Only show the add button if this is a list 1078d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmann mAddPlusButton.setVisibility(mKind.isList ? View.VISIBLE : View.INVISIBLE); 108da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann 109bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann rebuildFromState(); 110bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann updateAddEnabled(); 111bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann updateVisible(); 112bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann } 113bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann 114f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann public String getTitle() { 115f7ce5978a6a6314028fe9bbb1da99338b111750fDaniel Lehmann return mTitleString; 116aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 117aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 118aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey /** 119aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey * Build editors for all current {@link #mState} rows. 120aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey */ 121aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey public void rebuildFromState() { 122aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey // Remove any existing editors 123aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey mEditors.removeAllViews(); 124aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 125da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann // Check if we are displaying anything here 126da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann boolean hasEntries = mState.hasMimeEntries(mKind.mimeType); 127da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann 128da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann if (hasEntries) { 129da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann for (ValuesDelta entry : mState.getMimeEntries(mKind.mimeType)) { 130da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann // Skip entries that aren't visible 131da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann if (!entry.isVisible()) continue; 1323e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann if (isEmptyNoop(entry)) continue; 133da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann 134634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann createEditorView(entry); 135da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann } 136aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 137aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 138aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey 139634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann 140634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann /** 141634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann * Creates an EditorView for the given entry. This function must be used while constructing 142634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann * the views corresponding to the the object-model. The resulting EditorView is also added 143634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann * to the end of mEditors 144634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann */ 145634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann private View createEditorView(ValuesDelta entry) { 146634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann final View view; 147634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann if (mKind.editorClass == null) { 148392ccec3b56e8074a5a028af28106134b39f64bcDaniel Lehmann view = new TextFieldsEditorView(mContext); 149634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } else { 150634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann try { 151634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann view = mKind.editorClass.getConstructor(Context.class).newInstance( 152634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann mContext); 153634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } catch (Exception e) { 154634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann throw new RuntimeException( 155634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann "Cannot allocate editor for " + mKind.editorClass); 156634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } 157634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } 158634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann 159634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann if (view instanceof Editor) { 160634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann Editor editor = (Editor) view; 161634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann editor.setValues(mKind, entry, mState, mReadOnly, mViewIdGenerator); 162634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann editor.setEditorListener(this); 163634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann editor.setDeletable(true); 164634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } 165634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann mEditors.addView(view); 166634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann return view; 167634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann } 168634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann 1699e83c84a7603eb6fca1b42631d894731d61f7a34Daniel Lehmann /** 1703e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann * Tests whether the given item has no changes (so it exists in the database) but is empty 1713e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann */ 1723e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann private boolean isEmptyNoop(ValuesDelta item) { 1733e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann if (!item.isNoop()) return false; 1743e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann final int fieldCount = mKind.fieldList.size(); 1753e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann for (int i = 0; i < fieldCount; i++) { 1763e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann final String column = mKind.fieldList.get(i).column; 1773e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann final String value = item.getAsString(column); 1783e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann if (!TextUtils.isEmpty(value)) return false; 1793e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann } 1803e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann return true; 1813e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann } 1823e7436450f0fdd5ad939c3b46e7176e082c9ee11Daniel Lehmann 183bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann private void updateVisible() { 184bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann setVisibility(getEditorCount() != 0 ? VISIBLE : GONE); 185bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann } 186bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann 187bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann 188aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey protected void updateAddEnabled() { 189aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey // Set enabled state on the "add" view 190aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey final boolean canInsert = EntityModifier.canInsert(mState, mKind); 191da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann final boolean isEnabled = !mReadOnly && canInsert; 1928d8e2e838babfcaca2eaff99862652ce3aceac29Daniel Lehmann mAddPlusButton.setEnabled(isEnabled); 193aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 1946f8d46b5fb96c2bead1317aae93a73fc89b093abJeff Sharkey 195bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann public void addItem() { 196bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann // if this is a list, we can freely add. if not, only allow adding the first 197bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann if (!mKind.isList && getEditorCount() == 1) 198da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann return; 199da5fd9039bd303f5e4634a31ed9a00d58d679b39Daniel Lehmann 200634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann // Insert a new child, create its view and set its focus 2014b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki final ValuesDelta newValues = EntityModifier.insertChild(mState, mKind); 202634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann final View newField = createEditorView(newValues); 203634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann newField.requestFocus(); 2044b722a93f1ecdeb2890fb7e5db4c22794bccfdcdMakoto Onuki 205634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann // For non-lists (e.g. Notes we can only have one field. in that case we need to disable 206634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann // the add button 207634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann updateAddEnabled(); 208eeac4dc8dccb20466669525f16dc58fa593a3483Daniel Lehmann 209634ab3baaf2bc69bd7977153fcdebf0e737e207dDaniel Lehmann // Ensure we are visible 210bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann updateVisible(); 211bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann } 212bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann 213bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann public int getEditorCount() { 214bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann return mEditors.getChildCount(); 215bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann } 216bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann 217bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann public DataKind getKind() { 218bb556954e29ae0700b729f128d8cd09ecdd91ee3Daniel Lehmann return mKind; 219aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey } 220aad8848282f51d73ad308e9ad3ebcef592fa153fJeff Sharkey} 221