本文整理汇总了Java中org.eclipse.jface.viewers.TreeNode.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.getValue方法的具体用法?Java TreeNode.getValue怎么用?Java TreeNode.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.TreeNode
的用法示例。
在下文中一共展示了TreeNode.getValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getText
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public String getText(final Object element) {
final TreeNode treeNode = (TreeNode) element;
final Object value = treeNode.getValue();
if (value instanceof DBObject) {
final DBObject dbObject = (DBObject) value;
return dbObject.getName();
} else if (value instanceof StringObjectModel) {
final StringObjectModel object = (StringObjectModel) value;
return object.getName();
} else if (value instanceof TestData) {
final TestData testData = (TestData) value;
return testData.getName();
}
return value.toString();
}
示例2: getText
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public String getText(Object element) {
TreeNode treeNode = (TreeNode) element;
Object value = treeNode.getValue();
if (value instanceof DBObject) {
DBObject dbObject = (DBObject) value;
return dbObject.getName();
} else if (value instanceof StringObjectModel) {
StringObjectModel object = (StringObjectModel) value;
return object.getName();
} else if (value instanceof TestData) {
TestData testData = (TestData) value;
return testData.getName();
}
return value.toString();
}
示例3: getText
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public String getText(Object element) {
final TreeNode treeNode = (TreeNode) element;
final Object value = treeNode.getValue();
if (value instanceof DBObject) {
final DBObject dbObject = (DBObject) value;
return dbObject.getName();
} else if (value instanceof StringObjectModel) {
final StringObjectModel object = (StringObjectModel) value;
return object.getName();
}
return value.toString();
}
示例4: getText
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public String getText(Object element) {
TreeNode td = (TreeNode) element;
ConceptTreeNode ctn = (ConceptTreeNode) td.getValue();
String result = "";
result += ctn.getConcept().toString();
return result;
}
示例5: createChildrenNodes
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
public static TreeNode[] createChildrenNodes(TreeNode parent, Object element) {
ObjectFieldDefinition fieldDefinition = (ObjectFieldDefinition) parent.getValue();
List<ObjectFieldDefinition> innerElements = fieldDefinition.getInnerElements();
if ((innerElements == null || innerElements.isEmpty())) {
innerElements = new ArrayList<ObjectFieldDefinition>();
ObjectFieldDefinition children = ObjectFieldDefinitionFactory.createFromObject(element, fieldDefinition.getPath().getRootExpression(), fieldDefinition.getPath());
innerElements.addAll(children.getInnerElements());
return doCreateChildrenNodes(parent, innerElements);
} else {
return doCreateChildrenNodes(parent, innerElements);
}
}
示例6: setData
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void setData() {
final ExportTestDataSetting exportTestDataSetting = settings.getExportSetting().getExportTestDataSetting();
setTestDataTable();
if (targetIndex >= 0) {
final TreeNode rootNode = ((TreeNode[]) testDataTable.getInput())[0];
for (final TreeNode treeNode : rootNode.getChildren()) {
if (treeNode.getValue() == testDataList.get(targetIndex)) {
testDataTable.setChecked(treeNode, true);
}
}
} else {
testDataTable.setCheckedElements((TreeNode[]) testDataTable.getInput());
}
fileEncodingCombo.setEnabled(true);
if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT) {
formatDBUnitRadio.setSelection(true);
} else if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT_FLAT_XML) {
formatDBUnitFlatXmlRadio.setSelection(true);
} else if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT_XLS) {
formatDBUnitXlsRadio.setSelection(true);
fileEncodingCombo.setEnabled(false);
} else {
formatSqlRadio.setSelection(true);
}
String outputDirectoryPath = exportTestDataSetting.getExportFilePath();
if (Check.isEmpty(outputDirectoryPath)) {
outputDirectoryPath = "testdata";
}
outputDirectoryText.setText(outputDirectoryPath);
fileEncodingCombo.setText(exportTestDataSetting.getExportFileEncoding());
}
示例7: setData
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void setData() {
ExportTestDataSetting exportTestDataSetting = this.settings
.getExportSetting().getExportTestDataSetting();
setTestDataTable();
if (this.targetIndex >= 0) {
TreeNode rootNode = ((TreeNode[]) this.testDataTable.getInput())[0];
for (TreeNode treeNode : rootNode.getChildren()) {
if (treeNode.getValue() == this.testDataList
.get(this.targetIndex)) {
this.testDataTable.setChecked(treeNode, true);
}
}
} else {
this.testDataTable
.setCheckedElements((TreeNode[]) this.testDataTable
.getInput());
}
this.fileEncodingCombo.setEnabled(true);
if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT) {
this.formatDBUnitRadio.setSelection(true);
} else if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT_FLAT_XML) {
this.formatDBUnitFlatXmlRadio.setSelection(true);
} else if (exportTestDataSetting.getExportFormat() == TestData.EXPORT_FORMT_DBUNIT_XLS) {
this.formatDBUnitXlsRadio.setSelection(true);
this.fileEncodingCombo.setEnabled(false);
} else {
this.formatSqlRadio.setSelection(true);
}
String outputDirectoryPath = exportTestDataSetting.getExportFilePath();
if (Check.isEmpty(outputDirectoryPath)) {
outputDirectoryPath = "testdata";
}
this.outputDirectoryText.setText(outputDirectoryPath);
this.fileEncodingCombo.setText(exportTestDataSetting
.getExportFileEncoding());
}
示例8: doubleClick
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public void doubleClick(DoubleClickEvent event) {
System.out.println(event.getSelection().toString());
ITreeSelection sel= (ITreeSelection) event.getSelection();
TreeNode tn = (TreeNode) sel.iterator().next();
ConceptTreeNode ctn = (ConceptTreeNode) tn.getValue();
System.out.println("Double Clicked on: "+ctn.getConcept().getURI());
if(GraphAnalyse.vv != null) {
Graph<JungVertex, JungEdge> g = GraphAnalyse.createGraphModel(ctn.getConcept().getURI());
GraphAnalyse.vv.getGraphLayout().setGraph(g);
GraphAnalyse.vv.repaint();
}
}
示例9: decorate
import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
public void decorate(Object element, IDecoration decoration) {
if (element instanceof TreeNode) {
SVoNtProject sp = SVoNtManager.getSVoNtProjectByID(ConceptTree.ontologyStore.getId());
if (sp!= null) {
TreeNode td = (TreeNode) element;
ConceptTreeNode ctn = (ConceptTreeNode) td.getValue();
OWLClass cl = ctn.getConcept();
String suffix = " ";
RevisionInfo ri;
ri = (RevisionInfo) ((sp.getRevisionMap().get(cl) != null)
? sp.getRevisionInformationMap().get(sp.getRevisionMap().get(cl))
: sp.getRevisionInformationMap().get(sp.getHeadRev()));
suffix += "["+String.valueOf(ri.getRevision()+ " "+ri.getDate() + " "+ ri.getAuthor()+"]");
// System.out.println("Decorating a TreeNode");
decoration.addSuffix(suffix);
// decoration.
// ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
// decoration.
//
// Color c = new Color(Display.getDefault(),149,125,71);
// decoration.
// decoration.setForegroundColor(c);
}
}
}