本文整理汇总了Java中org.eclipse.jface.viewers.TreeExpansionEvent.getElement方法的典型用法代码示例。如果您正苦于以下问题:Java TreeExpansionEvent.getElement方法的具体用法?Java TreeExpansionEvent.getElement怎么用?Java TreeExpansionEvent.getElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.TreeExpansionEvent
的用法示例。
在下文中一共展示了TreeExpansionEvent.getElement方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dialogTreeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
private void dialogTreeExpanded(TreeExpansionEvent event) {
FJTree parent = (FJTree) event.getElement();
if (parent != null) {
Object[] children = parent.getChildren();
for (int i = 0; i < children.length; i++) {
FJTree child = (FJTree) children[i];
int checkState = child.getCheckState();
if (checkState == FJTree.CS_CHECKED) {
fileTree.setChecked(child, true);
fileTree.setGrayed(child, false);
} else if (checkState == FJTree.CS_UNCHECKED)
fileTree.setChecked(child, false);
else if (checkState == FJTree.CS_GRAYED)
fileTree.setGrayChecked(child, true);
}
}
dialogChanged();
}
示例2: dialogTreeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
private void dialogTreeExpanded(TreeExpansionEvent event) {
FJTree parent = (FJTree)event.getElement();
if (parent != null) {
Object[] children = parent.getChildren();
for (int i=0; i<children.length; i++) {
FJTree child = (FJTree)children[i];
int checkState = child.getCheckState();
if (checkState == FJTree.CS_CHECKED) {
fileTree.setChecked(child, true);
fileTree.setGrayed(child, false);
}
else if (checkState == FJTree.CS_UNCHECKED)
fileTree.setChecked(child, false);
else if (checkState == FJTree.CS_GRAYED)
fileTree.setGrayChecked(child, true);
}
}
dialogChanged();
}
示例3: lazyLoadResource
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
public IStatus lazyLoadResource(final TreeExpansionEvent event, IProgressMonitor monitor) {
if (skipLazyLoad)
return Status.OK_STATUS;
MResource r = (MResource) event.getElement();
try {
WSClientHelper.refreshResource(r, monitor);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
event.getTreeViewer().refresh(true);
}
});
return Status.OK_STATUS;
} catch (final Throwable e) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
event.getTreeViewer().collapseToLevel(event.getElement(), 1);
UIUtils.showErrorDialog(e.getMessage(), e);
}
});
}
return Status.CANCEL_STATUS;
}
示例4: listServer
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
private IStatus listServer(final TreeExpansionEvent event, final IProgressMonitor monitor) {
final TreeViewer tv = (TreeViewer) event.getTreeViewer();
final MServerProfile r = (MServerProfile) event.getElement();
try {
WSClientHelper.connectGetData(r, monitor);
UIUtils.getDisplay().asyncExec(new Runnable() {
public void run() {
tv.refresh(r, true);
}
});
return Status.OK_STATUS;
} catch (final Throwable e) {
UIUtils.getDisplay().syncExec(new Runnable() {
public void run() {
tv.collapseToLevel(r, 1);
if (!monitor.isCanceled())
UIUtils.showErrorDialog(e.getMessage(), e);
}
});
}
return Status.CANCEL_STATUS;
}
示例5: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
public void treeExpanded(TreeExpansionEvent event)
{
Object item = event.getElement();
if(!fExpandedTreeNodes.contains(item))
{
fExpandedTreeNodes.add(item);
checkNewTreeElements(getTreeChildren(item));
}
}
示例6: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
/**
* Handles the expansionsion of an element in a tree viewer
* @param event
*/
public void treeExpanded(TreeExpansionEvent event) {
Object item= event.getElement();
// First see if the children need to be given their checked state at all. If they've
// already been realized then this won't be necessary
if (!fExpandedTreeNodes.contains(item)) {
fExpandedTreeNodes.add(item);
checkNewTreeElements(getTreeChildren(item));
}
}
示例7: handleTreeEvent
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
public void handleTreeEvent(TreeExpansionEvent event) {
if (event.getElement() instanceof MServerProfile)
listServer(event);
else if (event.getElement() instanceof MResource)
lazyLoadResource(event);
}
示例8: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
public void treeExpanded(TreeExpansionEvent event) {
Object element= event.getElement();
if (element instanceof ICompilationUnit ||
element instanceof IClassFile)
expandMainType(element);
}
示例9: treeCollapsed
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
@Override
public void treeCollapsed(TreeExpansionEvent event) {
if (event.getElement() instanceof IResource) {
evaluateProject(((IResource) event.getElement()).getProject());
}
}
示例10: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入方法依赖的package包/类
@Override
public void treeExpanded(TreeExpansionEvent event) {
if (event.getElement() instanceof IResource) {
evaluateProject(((IResource) event.getElement()).getProject());
}
}