private final static String[] sRootLevelApprovedItems = { DIRECTORY_DATA,
DIRECTORY_SDCARD, DIRECTORY_SYSTEM, DIRECTORY_TEMP, DIRECTORY_MNT, };
- public static final long REFRESH_RATE = 5000L;
+ public static final long REFRESH_RATE = 99995000L;
/**
* Refresh test has to be slightly lower for precision issue.
*/
/**
* Regexp pattern to parse the result from ls.
*/
- // String permissions = m.group(1);
- // String owner = m.group(2);
- // String group = m.group(3);
- // String size = m.group(4);
- // String date = m.group(5);
- // String time = m.group(6);
- // String info = null;
- // -rwxr-xr-x 1 mustafa mustafa 310547 2011-08-23 14:52 adb
- // -rw-r--r-- 1 root root 26591 Aug 19 11:14 COPYING
+
private static String patternPermisions = "([bcdlsp-][-r][-w][-xsS][-r][-w][-xsS][-r][-w][-xstST])";
- private static String patternFilecount = "(\\d)";
+ private static String patternFilecount = "(\\d{1,})";
private static String patternOwner = "(\\S+)";
private static String patternGroup = "(\\S+)";
private static String patternSize = "([\\d\\s,]*)";
- private static String patternDate = "([A-Z][a-z]{2}\\s\\d\\d)";
- private static String patternTime = "(\\d\\d:\\d\\d)";
+ private static String patternDate = "([a-zA-Z]{3}\\s\\d{1,2})";
+ private static String patternTime = "(\\d{1,2}:\\d{1,2})";
private static String patternName = "(.*)";
private static String patternLsEmulator = "^" + patternPermisions + "\\s+"
+ patternFilecount + "\\s+" + patternOwner + "\\s+" + patternGroup
String time;
String owner;
String group;
+ String linkTo;
int type;
boolean isAppPackage;
public String getInfo() {
return info;
}
-
+ public String getLinkTo() {
+ return linkTo;
+ }
/**
* Return the full path of the entry.
*
String date = m.group(6);
String time = m.group(7);
String info = null;
-
+ String linkTo = null;
// and the type
int objectType = TYPE_OTHER;
switch (permissions.charAt(0)) {
// and the link name
info = segments[1];
-
+ linkTo = segments[1];
// now get the path to the link
String[] pathSegments = info.split(FILE_SEPARATOR);
if (pathSegments.length == 1) {
entry.group = group;
if (objectType == TYPE_LINK) {
entry.info = info;
+ entry.linkTo = linkTo;
}
mEntryList.add(entry);
doLs(entry);
return entry.getCachedChildren();
}
-
+
// this is a asynchronous call.
// we launch a thread that will do ls and give the listing
// to the receiver
try {
// create the command
- String command = "ls -l " + entry.getFullPath(); //$NON-NLS-1$
+ String command = null;
+ if (entry.getType() == FileListingService.TYPE_LINK) {
+ if (entry.getLinkTo().charAt(0) == '/')
+ command = "ls -l " + entry.getLinkTo(); //$NON-NLS-1$
+ else
+ command = "ls -l /" + entry.getLinkTo(); //$NON-NLS-1$
+ }else {
+ command = "ls -l " + entry.getFullPath(); //$NON-NLS-1$
+ }
// create the receiver object that will parse the result from ls
LsReceiver receiver = new LsReceiver(entry, entryList, linkList);
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-import com.samsung.slp.common.connection.ddmuilib.DevicePanel.IUiSelectionListener;
-import com.samsung.slp.common.connection.ddmuilib.DevicePanel;
import com.samsung.slp.common.connection.ConnectionActivator;
import com.samsung.slp.common.connection.ConnectionActivator.ISelectionListener;
-import com.samsung.slp.common.connection.ddmuilib.ImageLoader;
-import com.samsung.slp.common.connection.ddmuilib.explorer.DeviceExplorer;
import com.samsung.slp.common.connection.ddmlib.AndroidDebugBridge;
import com.samsung.slp.common.connection.ddmlib.Client;
import com.samsung.slp.common.connection.ddmlib.IDevice;
+import com.samsung.slp.common.connection.ddmuilib.DevicePanel;
+import com.samsung.slp.common.connection.ddmuilib.DevicePanel.IUiSelectionListener;
+import com.samsung.slp.common.connection.ddmuilib.ImageLoader;
+import com.samsung.slp.common.connection.ddmuilib.explorer.DeviceExplorer;
-public class ConnectionsView extends ViewPart implements IUiSelectionListener,ISelectionListener{
+public class ConnectionsView extends ViewPart implements IUiSelectionListener,
+ ISelectionListener {
private TableViewer Connections;
private final static String COLUMN_NAME = ConnectionActivator.PLUGIN_ID
+ ".explorer.permissions"; //$NON-NLS-1S
private final static String COLUMN_INFO = ConnectionActivator.PLUGIN_ID
+ ".explorer.info"; //$NON-NLS-1$
-
+
private final static boolean USE_SELECTED_DEBUG_PORT = true;
private DeviceExplorer mExplorer;
private Shell mParentShell;
@Override
public void createPartControl(Composite parent) {
- createViewer(parent);
- //createFileExplorerView(parent);
+ // createViewer(parent);
+ createFileExplorerView(parent);
}
-
- private void createViewer(Composite parent)
- {
-
+
+ private void createViewer(Composite parent) {
+
mParentShell = parent.getShell();
ImageLoader loader = ImageLoader.getDdmUiLibLoader();
mDeviceList = new DevicePanel(USE_SELECTED_DEBUG_PORT);
mDeviceList.createPanel(parent);
mDeviceList.addSelectionListener(this);
-
+
mCaptureAction = new Action("Screen Capture") {
@Override
public void run() {
};
mCaptureAction.setToolTipText("Screen Capture");
- mCaptureAction.setImageDescriptor(loader.loadDescriptor("Export Log.gif"));
-
+ mCaptureAction.setImageDescriptor(loader
+ .loadDescriptor("Export Log.gif"));
+
placeActions();
}
menuManager.removeAll();
menuManager.add(mCaptureAction);
menuManager.add(new Separator());
-
+
// and then in the toolbar
IToolBarManager toolBarManager = actionBars.getToolBarManager();
toolBarManager.removeAll();
toolBarManager.add(new Separator());
}
- private void createFileExplorerView(Composite parent)
- {
+ private void createFileExplorerView(Composite parent) {
ImageLoader loader = ImageLoader.getDdmUiLibLoader();
- DeviceExplorer.COLUMN_NAME = COLUMN_NAME;
- DeviceExplorer.COLUMN_SIZE = COLUMN_SIZE;
- DeviceExplorer.COLUMN_DATE = COLUMN_DATE;
- DeviceExplorer.COLUMN_TIME = COLUMN_TIME;
- DeviceExplorer.COLUMN_PERMISSIONS = COLUMN_PERMISSIONS;
- DeviceExplorer.COLUMN_INFO = COLUMN_INFO;
-
- // device explorer
- mExplorer = new DeviceExplorer();
- mExplorer.createPanel(parent);
- IDevice[] devices = AndroidDebugBridge.getBridge().getDevices();
+ DeviceExplorer.COLUMN_NAME = COLUMN_NAME;
+ DeviceExplorer.COLUMN_SIZE = COLUMN_SIZE;
+ DeviceExplorer.COLUMN_DATE = COLUMN_DATE;
+ DeviceExplorer.COLUMN_TIME = COLUMN_TIME;
+ DeviceExplorer.COLUMN_PERMISSIONS = COLUMN_PERMISSIONS;
+ DeviceExplorer.COLUMN_INFO = COLUMN_INFO;
+
+ // device explorer
+ mExplorer = new DeviceExplorer();
+ mExplorer.createPanel(parent);
+ IDevice[] devices = AndroidDebugBridge.getBridge().getDevices();
String deviceSerial = null;
for (IDevice d : devices) {
deviceSerial = d.getSerialNumber();
System.out.println(deviceSerial);
mExplorer.switchDevice(d);
- }
-
- //ConnectionActivator.getDefault().addSelectionListener(this);
- }
+ }
+ mExplorer.setCustomImages(
+ PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FILE),
+ PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FOLDER),
+ null /* apk image */,
+ PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_ELEMENT));
+
+ // ConnectionActivator.getDefault().addSelectionListener(this);
+ }
+
@Override
public void setFocus() {
// TODO Auto-generated method stub
-
+
}
@Override
public void selectionChanged(Client selectedClient) {
// TODO Auto-generated method stub
-
+
}
@Override
public void selectionChanged(IDevice selectedDevice) {
// TODO Auto-generated method stub
mExplorer.switchDevice(selectedDevice);
-
+
}
@Override
public void selectionChanged(IDevice selectedDevice, Client selectedClient) {
// TODO Auto-generated method stub
// update the buttons
- //doSelectionChanged(selectedClient);
- //doSelectionChanged(selectedDevice);
+ // doSelectionChanged(selectedClient);
+ // doSelectionChanged(selectedDevice);
}
}