本文整理汇总了Java中com.nextgis.maplib.datasource.ngw.Connection.NGWResourceTypeConnection方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.NGWResourceTypeConnection方法的具体用法?Java Connection.NGWResourceTypeConnection怎么用?Java Connection.NGWResourceTypeConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nextgis.maplib.datasource.ngw.Connection
的用法示例。
在下文中一共展示了Connection.NGWResourceTypeConnection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItem
import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public Object getItem(int i)
{
if (null == mCurrentResource || mLoading) {
return null;
}
if (mCurrentResource.getType() == Connection.NGWResourceTypeConnections) {
if (i > mCurrentResource.getChildrenCount()) {
return null;
}
return mCurrentResource.getChild(i);
} else if (mCurrentResource.getType() == Connection.NGWResourceTypeConnection) {
int offset = mShowAccounts ? 1 : 0;
if (i == 0 && mShowAccounts) {
return null;
}
return mCurrentResource.getChild(i - offset);
} else if (mCurrentResource.getType() == Connection.NGWResourceTypeResourceGroup) {
if (i == 0) {
return null;
}
return mCurrentResource.getChild(i - 1);
}
return null;
}
示例2: getView
import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public View getView(
int i,
View view,
ViewGroup viewGroup)
{
//show loading view
if (mLoading) {
if (isAccountsDisabled())
return getLoadingView(view);
else if (i > 0)
return getLoadingView(view);
}
switch (mCurrentResource.getType()) {
case Connection.NGWResourceTypeConnections:
final Connection connection = (Connection) getItem(i);
return getConnectionView(connection, view);
case Connection.NGWResourceTypeConnection:
case Connection.NGWResourceTypeResourceGroup:
Resource resource = (Resource) getItem(i);
return getResourceView(resource, view);
default:
return null;
}
}
示例3: onItemClick
import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public void onItemClick(
AdapterView<?> adapterView,
View view,
int i,
long l)
{
if (mCurrentResource.getType() == Connection.NGWResourceTypeConnections) {
if (i >= mCurrentResource.getChildrenCount()) {
//start add account activity
if (mConnectionListener != null)
mConnectionListener.onAddConnection();
} else {
Connection connection = (Connection) mCurrentResource.getChild(i);
mCurrentResource = connection;
if (mConnectionListener != null) {
mConnectionListener.onConnectionSelected(connection);
} else if (connection.isConnected()) {
notifyDataSetChanged();
} else {
NGWResourceAsyncTask task = new NGWResourceAsyncTask(mContext, connection);
task.execute();
}
}
} else if (mCurrentResource.getType() == Connection.NGWResourceTypeConnection) {
if (mShowAccounts) {
if (i == 0)
goUp();
else
goDeep(i - 1);
} else
goDeep(i);
} else if (mCurrentResource.getType() == Connection.NGWResourceTypeResourceGroup) {
if (i == 0)
goUp();
else
goDeep(i - 1);
}
mPathView.onUpdate(mCurrentResource);
}