List of usage examples for org.eclipse.jface.viewers ViewerCell setText
public void setText(String text)
From source file:com.netxforge.netxstudio.callflow.screens.CallFlowsTreeLabelProvider.java
License:Open Source License
private void updateColumn4(ViewerCell cell, Object element) { if (element instanceof ServiceFlowRelationship) { ServiceFlowRelationship rel = (ServiceFlowRelationship) element; if (rel.eIsSet(ServicesPackage.Literals.SERVICE_FLOW_RELATIONSHIP__REFERENCE_RELATIONSHIP)) { ServiceFlowDirection direction = rel.getDirection(); if (direction != null) { switch (direction.getValue()) { case ServiceFlowDirection.LEFTTORIGHT_VALUE: { cell.setText("-->"); }//www .jav a 2 s . com break; case ServiceFlowDirection.RIGHTTOLEFT_VALUE: { cell.setText("<--"); } break; } } else { cell.setText("-"); } } } else if (element instanceof ReferenceRelationship) { ReferenceRelationship referenceRelationship = (ReferenceRelationship) element; if (referenceRelationship.eIsSet(LibraryPackage.Literals.REFERENCE_RELATIONSHIP__PROTOCOL_REF)) { Protocol protocolRef = referenceRelationship.getProtocolRef(); // Set the name of the Node Type. StyledString styledString = new StyledString(protocolRef.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else { cell.setText("-"); } } }
From source file:com.netxforge.netxstudio.callflow.screens.CallFlowsTreeLabelProvider.java
License:Open Source License
private void updateColumn2(ViewerCell cell, Object element) { if (element instanceof ServiceFlowRelationship) { ServiceFlowRelationship rel = (ServiceFlowRelationship) element; if (rel.eIsSet(ServicesPackage.Literals.SERVICE_FLOW_RELATIONSHIP__REFERENCE_RELATIONSHIP)) { ReferenceRelationship referenceRelationship = rel.getReferenceRelationship(); // Set the name of the Node Type. StyledString styledString = new StyledString(); NodeType nt1 = referenceRelationship.getRefInterface1Ref(); NodeType nt2 = referenceRelationship.getRefInterface2Ref(); StringBuffer buf = new StringBuffer(); buf.append(" ("); buf.append(nt1 != null ? nt1.getName() : " ?"); buf.append(" <--> "); buf.append(nt2 != null ? nt2.getName() : " ?"); buf.append(")"); String typedName = referenceRelationship.getName(); styledString.append(typedName != null && typedName.length() > 0 ? referenceRelationship.getName() + " :" + buf.toString() : buf.toString());/*from w w w.ja v a 2 s .c o m*/ // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); cell.setText(styledString.getString()); } else if (rel.eIsSet(ServicesPackage.Literals.SERVICE_FLOW_RELATIONSHIP__SERVICE_FLOW)) { ServiceFlow serviceFlow = rel.getServiceFlow(); StringBuffer buf = new StringBuffer(); buf.append("["); buf.append(serviceFlow.getName()); buf.append("]"); cell.setText(buf.toString()); } else { cell.setText("-"); } } else if (element instanceof ReferenceRelationship) { ReferenceRelationship referenceRelationship = (ReferenceRelationship) element; if (referenceRelationship.eIsSet(LibraryPackage.Literals.REFERENCE_RELATIONSHIP__REF_INTERFACE1_REF)) { NodeType nodeTypeRef = referenceRelationship.getRefInterface1Ref(); // Set the name of the Node Type. StyledString styledString = new StyledString(nodeTypeRef.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else { cell.setText("-"); } } }
From source file:com.netxforge.netxstudio.callflow.screens.CallFlowsTreeLabelProvider.java
License:Open Source License
private void updateColumn3(ViewerCell cell, Object element) { if (element instanceof ServiceFlowRelationship) { ServiceFlowRelationship rel = (ServiceFlowRelationship) element; if (rel.eIsSet(ServicesPackage.Literals.SERVICE_FLOW_RELATIONSHIP__REFERENCE_RELATIONSHIP)) { ReferenceRelationship referenceRelationship = rel.getReferenceRelationship(); // Check if the interface is set. if (referenceRelationship .eIsSet(LibraryPackage.Literals.REFERENCE_RELATIONSHIP__REF_INTERFACE1_REF)) { NodeType nodeTypeRef = referenceRelationship.getRefInterface1Ref(); // Set the name of the Node Type. StyledString styledString = new StyledString(nodeTypeRef.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); }//from ww w.j av a2 s.c om } else { cell.setText("-"); } } else if (element instanceof ReferenceRelationship) { ReferenceRelationship referenceRelationship = (ReferenceRelationship) element; if (referenceRelationship.eIsSet(LibraryPackage.Literals.REFERENCE_RELATIONSHIP__REF_INTERFACE2_REF)) { NodeType nodeTypeRef = referenceRelationship.getRefInterface2Ref(); // Set the name of the Node Type. StyledString styledString = new StyledString(nodeTypeRef.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else { cell.setText("-"); } } }
From source file:com.netxforge.netxstudio.callflow.screens.CallFlowsTreeLabelProvider.java
License:Open Source License
private void updateColumn1(ViewerCell cell, Object element) { if (element instanceof ServiceFlow) { ServiceFlow serviceFlow = (ServiceFlow) element; StyledString styledString = new StyledString(serviceFlow.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof ReferenceRelationship) { ///* w w w.j av a2 s . c o m*/ ReferenceRelationship rel = (ReferenceRelationship) element; StyledString styledString = new StyledString(); if (rel.eIsSet(LibraryPackage.Literals.REFERENCE_RELATIONSHIP__NAME)) { styledString.append(rel.getName(), null); } // Styler metricColorStyler = // StyledString.createColorRegistryStyler( // YELLOW_COLOR_STYLER, null); NodeType nt1 = rel.getRefInterface1Ref(); NodeType nt2 = rel.getRefInterface2Ref(); StringBuffer buf = new StringBuffer(); buf.append(" ("); buf.append(nt1 != null ? nt1.getName() : " ?"); buf.append(" <--> "); buf.append(nt2 != null ? nt2.getName() : " ?"); buf.append(")"); // // Set the name of the Node Type. styledString.append(buf.toString(), StyledString.COUNTER_STYLER); // cell.setText(styledString.getString()); // // // Image img = ResourceManager.getPluginImage( // // // "com.netxforge.netxstudio.models.edit", // // // "icons/full/obj16/Company_H.png"); // // // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); cell.setText(styledString.getString()); } }
From source file:com.netxforge.netxstudio.callflow.screens.CallFlowsTreeLabelProvider.java
License:Open Source License
private void updateColumn0(ViewerCell cell, Object element) { if (element instanceof ServiceFlow) { ServiceFlow serviceFlow = (ServiceFlow) element; StyledString styledString = new StyledString(indexFor(null, serviceFlow), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof ReferenceRelationship) { ReferenceRelationship relationship = (ReferenceRelationship) element; StyledString styledString = new StyledString( indexFor(LibraryPackage.Literals.REFERENCE_NETWORK__REF_RELATIONSHIPS, relationship), null); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); }// ww w.j av a 2s . c om }
From source file:com.netxforge.netxstudio.callflow.screens.nodetypes.NodeTypeTreeLabelProvider.java
License:Open Source License
@Override public void update(ViewerCell cell) { Object element = cell.getElement(); if (element instanceof ReferenceNetwork) { ReferenceNetwork network = (ReferenceNetwork) element; StyledString styledString = new StyledString(network.getName() != null ? network.getName() : "?", null); // String decoration = " (" + network.getFunctions().size() + // " Functions)" // + " (" + network.getFunctions().size() + " Equipments)"; // styledString.append(decoration, StyledString.COUNTER_STYLER); cell.setText(styledString.getString()); Image img = ResourceManager.getPluginImage("com.netxforge.netxstudio.models.edit", "icons/full/obj16/Network_H.png"); cell.setImage(img);/*from w ww . j ava2 s . c o m*/ cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof NodeType) { NodeType nt = (NodeType) element; // NodeTypeSummary tt = (NodeTypeSummary) stateModel.summary(nt); // tt.compute(null); StyledString styledString = new StyledString(nt.getName() != null ? nt.getName() : "?", null); // String decoration = " (" + tt.getFunctionCountAsString() + // " Functions)" // + " (" + tt.getEquipmentCountAsString() + " Equipments)"; // styledString.append(decoration, StyledString.COUNTER_STYLER); cell.setText(styledString.getString()); Image img = ResourceManager.getPluginImage("com.netxforge.netxstudio.models.edit", "icons/full/obj16/Node_H.png"); cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof Function) { Function fc = (Function) element; StyledString styledString = new StyledString(fc.getName() != null ? fc.getName() : "?", null); String decoration = " (" + fc.getResourceRefs().size() + " Resources)"; styledString.append(decoration, StyledString.COUNTER_STYLER); cell.setText(styledString.getString()); Image img = ResourceManager.getPluginImage("com.netxforge.netxstudio.models.edit", "icons/full/obj16/Function_H.png"); cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof Equipment) { Equipment eq = (Equipment) element; StyledString styledString = new StyledString( eq.getEquipmentCode() != null ? eq.getEquipmentCode() : "?", null); String decoration = " (" + eq.getResourceRefs().size() + " Resources)"; styledString.append(decoration, StyledString.COUNTER_STYLER); cell.setText(styledString.getString()); Image img = ResourceManager.getPluginImage("com.netxforge.netxstudio.models.edit", "icons/full/obj16/Equipment_H.png"); cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof NetXResource) { NetXResource eq = (NetXResource) element; StyledString styledString = new StyledString(eq.getShortName() != null ? eq.getShortName() : "?", null); // String decoration = " (" + eq.getResources().size() + // " Resources)"; // styledString.append(decoration, StyledString.COUNTER_STYLER); cell.setText(styledString.getString()); Image img = ResourceManager.getPluginImage("com.netxforge.netxstudio.models.edit", "icons/full/obj16/Resource_H.gif"); cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } }
From source file:com.netxforge.netxstudio.callflow.screens.protocols.ProtocolsTreeLabelProvider.java
License:Open Source License
private void updateColumn0(ViewerCell cell, Object element) { if (element instanceof Protocol) { Protocol protocol = (Protocol) element; StyledString styledString = new StyledString(indexFor(null, protocol), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof Procedure) { Procedure proc = (Procedure) element; StyledString styledString = new StyledString( indexFor(ProtocolsPackage.Literals.PROTOCOL__PROCEDURES, proc), null); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof Message) { Message msg = (Message) element; StyledString styledString = new StyledString( indexFor(ProtocolsPackage.Literals.PROCEDURE__MESSAGES, msg), null); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); }// w w w . j av a 2 s .c om }
From source file:com.netxforge.netxstudio.callflow.screens.protocols.ProtocolsTreeLabelProvider.java
License:Open Source License
private void updateColumn1(ViewerCell cell, Object element) { if (element instanceof Protocol) { Protocol serviceFlow = (Protocol) element; StyledString styledString = new StyledString(serviceFlow.getName(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); } else if (element instanceof Procedure) { Procedure procedure = (Procedure) element; StyledString styledString = new StyledString(procedure.getName()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setText(styledString.getString()); } else if (element instanceof Message) { Message procedure = (Message) element; StyledString styledString = new StyledString(procedure.getName()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setText(styledString.getString()); }//w w w. ja va 2 s . c o m }
From source file:com.netxforge.netxstudio.callflow.screens.protocols.ProtocolsTreeLabelProvider.java
License:Open Source License
private void updateColumn2(ViewerCell cell, Object element) { if (element instanceof Protocol) { Protocol protocol = (Protocol) element; if (protocol.eIsSet(ProtocolsPackage.Literals.PROTOCOL__DESCRIPTION)) { StyledString styledString = new StyledString(protocol.getDescription(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); }/*from w w w. ja va2s .c o m*/ } else if (element instanceof Message) { Message msg = (Message) element; if (msg.eIsSet(ProtocolsPackage.Literals.MESSAGE__DESCRIPTION)) { StyledString styledString = new StyledString(msg.getDescription()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setText(styledString.getString()); } } }
From source file:com.netxforge.netxstudio.callflow.screens.protocols.ProtocolsTreeLabelProvider.java
License:Open Source License
private void updateColumn3(ViewerCell cell, Object element) { if (element instanceof Protocol) { Protocol protocol = (Protocol) element; if (protocol.eIsSet(ProtocolsPackage.Literals.PROTOCOL__OSI)) { OSIType osi = protocol.getOSI(); StyledString styledString = new StyledString(osi.getLiteral(), null); cell.setText(styledString.getString()); // Image img = ResourceManager.getPluginImage( // "com.netxforge.netxstudio.models.edit", // "icons/full/obj16/Company_H.png"); // cell.setImage(img); cell.setStyleRanges(styledString.getStyleRanges()); }/*from w ww . j a v a2 s . c om*/ } }