本文整理汇总了Java中com.android.ddmlib.FileListingService类的典型用法代码示例。如果您正苦于以下问题:Java FileListingService类的具体用法?Java FileListingService怎么用?Java FileListingService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileListingService类属于com.android.ddmlib包,在下文中一共展示了FileListingService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: switchDevice
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
/**
* Sets the new device to explorer
*/
public void switchDevice(final IDevice device) {
if (device != mCurrentDevice) {
mCurrentDevice = device;
// now we change the input. but we need to do that in the
// ui thread.
if (mTree.isDisposed() == false) {
Display d = mTree.getDisplay();
d.asyncExec(new Runnable() {
@Override
public void run() {
if (mTree.isDisposed() == false) {
// new service
if (mCurrentDevice != null) {
FileListingService fls = mCurrentDevice.getFileListingService();
mContentProvider.setListingService(fls);
mTreeViewer.setInput(fls.getRoot());
}
}
}
});
}
}
}
示例2: getColumnImage
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex == 0) {
if (element instanceof FileEntry) {
FileEntry entry = (FileEntry)element;
switch (entry.getType()) {
case FileListingService.TYPE_FILE:
case FileListingService.TYPE_LINK:
// get the name and extension
if (entry.isApplicationPackage()) {
return mPackageImage;
}
return mFileImage;
case FileListingService.TYPE_DIRECTORY:
case FileListingService.TYPE_DIRECTORY_LINK:
return mFolderImage;
}
}
// default case return a different image.
return mOtherImage;
}
return null;
}
示例3: hasChildren
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public boolean hasChildren(Object element) {
if (element instanceof FileEntry) {
FileEntry entry = (FileEntry)element;
return entry.getType() == FileListingService.TYPE_DIRECTORY;
}
return false;
}
示例4: getFileListingService
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public FileListingService getFileListingService() {
// TODO Auto-generated method stub
return null;
}
示例5: pull
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
public void pull(FileListingService.FileEntry[] entries, String localPath)
throws AdbCommandRejectedException, IOException, TimeoutException, SyncException {
new File(localPath).mkdirs();
iDevice.getSyncService().pull(entries,localPath, getNullProgressMonitor());
}
示例6: setListingService
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
public void setListingService(FileListingService fls) {
mFileListingService = fls;
}
示例7: run
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public void run(ISyncProgressMonitor monitor) throws SyncException,
TimeoutException, IOException {
try {
mSyncSvr = mCurDevice.getSyncService();
if ( mRemoteFullPath != null ) {
System.out.println("-->run:" + mRemoteFullPath);
System.out.println("-->run:" + mLocalName);
System.out.println("-->run:" + mFileSize);
SyncProgressMonitor syncMonitor = (SyncProgressMonitor) monitor;
MyProgessBar bar = (MyProgessBar) syncMonitor.getProgressMonitor();
bar.setMaximum(mFileSize);
mSyncSvr.pullFile(mRemoteFullPath, new File(mLocalName).getAbsolutePath(), monitor);
return;
}
String filePullName = null;
FileEntry singleEntry = null;
if (mRemoteFiles.length == 1) {
singleEntry = mRemoteFiles[0];
if (singleEntry.getType() == FileListingService.TYPE_FILE) {
filePullName = singleEntry.getName();
}
}
if (filePullName != null) {
mSyncSvr.pullFile(singleEntry,
new File(filePullName).getAbsolutePath(), monitor);
} else {
mSyncSvr.pull(mRemoteFiles, new File("./").getAbsolutePath(),
monitor);
}
} catch (AdbCommandRejectedException e) {
e.printStackTrace();
}
}
示例8: getFileListingService
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public FileListingService getFileListingService() {
throw new UnsupportedOperationException();
}
示例9: getFileListingService
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
@Override
public FileListingService getFileListingService() {
// TODO Auto-generated method stub
return null;
}
示例10: setDeleteEnabledState
import com.android.ddmlib.FileListingService; //导入依赖的package包/类
/**
* Sets the enabled state based on a FileEntry properties
* @param element The selected FileEntry
*/
protected void setDeleteEnabledState(FileEntry element) {
mDeleteAction.setEnabled(element.getType() == FileListingService.TYPE_FILE);
}