本文整理汇总了Java中com.android.ddmlib.Client.isValid方法的典型用法代码示例。如果您正苦于以下问题:Java Client.isValid方法的具体用法?Java Client.isValid怎么用?Java Client.isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.ddmlib.Client
的用法示例。
在下文中一共展示了Client.isValid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderClient
import com.android.ddmlib.Client; //导入方法依赖的package包/类
private static void renderClient(@NotNull Client c, ColoredTextContainer container) {
ClientData cd = c.getClientData();
String name = cd.getClientDescription();
if (name == null) {
return;
}
Pair<String, String> app = splitApplicationName(name);
container.append(app.getFirst(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
container.append(app.getSecond(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
if (cd.isValidUserId() && cd.getUserId() != 0) {
container.append(String.format(" (user %1$d)", cd.getUserId()), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
container.append(String.format(" (%1$d)", cd.getPid()), SimpleTextAttributes.GRAY_ATTRIBUTES);
if (!c.isValid()) {
container.append(" [DEAD]", SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
}
示例2: update
import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public final void update(AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
Client c = myDeviceContext.getSelectedClient();
if (c == null || !c.isValid()) {
presentation.setEnabled(false);
return;
}
String text = getActiveText(c);
presentation.setText(text);
presentation.setEnabled(true);
}
示例3: isSelected
import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public final boolean isSelected(AnActionEvent e) {
Client c = myDeviceContext.getSelectedClient();
if (c == null || !c.isValid()) {
return false;
}
return isSelected(c);
}
示例4: setSelected
import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public final void setSelected(AnActionEvent e, boolean state) {
Client c = myDeviceContext.getSelectedClient();
if (c == null || !c.isValid()) {
return;
}
setSelected(c);
}
示例5: isEnabled
import com.android.ddmlib.Client; //导入方法依赖的package包/类
protected final boolean isEnabled() {
Client c = myDeviceContext.getSelectedClient();
return (c != null && c.isValid());
}