use of org.eclipse.ui.progress.PendingUpdateAdapter in project cubrid-manager by CUBRID.
the class ExportObjectLabelProvider method update.
/**
* update
*
* @param cell ViewerCell
*/
public void update(ViewerCell cell) {
if (cell.getColumnIndex() == 0) {
if (cell.getElement() instanceof ICubridNode) {
ICubridNode node = (ICubridNode) cell.getElement();
cell.setImage(CommonUIPlugin.getImage(node.getIconPath()));
cell.setText(node.getName());
} else if (cell.getElement() instanceof PendingUpdateAdapter) {
cell.setText(Messages.msgLoading);
}
} else if (cell.getColumnIndex() == 1 && cell.getElement() instanceof ICubridNode) {
ICubridNode node = (ICubridNode) cell.getElement();
String condition = (String) node.getData(CONDITION);
if (condition != null) {
cell.setText(condition);
}
// cell can't edit ,set it to gray color
if (node.getType().equals(NodeType.TABLE_COLUMN)) {
cell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
}
}
use of org.eclipse.ui.progress.PendingUpdateAdapter in project cubrid-manager by CUBRID.
the class NavigatorTreeLabelProvider method getText.
public String getText(Object element) {
if (element instanceof ICubridNode) {
if (element instanceof CubridDatabase) {
CubridDatabase database = (CubridDatabase) element;
StringBuffer sbLabel = new StringBuffer();
sbLabel.append(((ICubridNode) element).getLabel());
DatabaseEditorConfig editorConfig = QueryOptions.getEditorConfig(database, true);
if (editorConfig != null && editorConfig.getDatabaseComment() != null && editorConfig.getDatabaseComment().length() > 0) {
sbLabel.append("(").append(editorConfig.getDatabaseComment()).append(")");
return sbLabel.toString();
}
} else if (element instanceof CubridBroker) {
CubridBroker broker = (CubridBroker) element;
BrokerInfo brokerInfo = broker.getBrokerInfo();
if (brokerInfo == null || brokerInfo.getAccess_mode() == null) {
return broker.getName();
}
return broker.getName() + " (" + brokerInfo.getPort() + "," + brokerInfo.getAccess_mode() + ")";
} else if (element instanceof CubridServer) {
CubridServer server = (CubridServer) element;
return decorateServerText(server.getLabel(), server);
}
return ((ICubridNode) element).getLabel();
} else if (element instanceof PendingUpdateAdapter) {
return com.cubrid.common.ui.common.Messages.msgLoading;
}
return element == null ? "" : element.toString();
}
use of org.eclipse.ui.progress.PendingUpdateAdapter in project cubrid-manager by CUBRID.
the class NavigatorTreeLabelProvider method getText.
public String getText(Object element) {
if (element instanceof ICubridNode) {
if (element instanceof CubridDatabase) {
CubridDatabase database = (CubridDatabase) element;
StringBuffer sbLabel = new StringBuffer();
sbLabel.append(((ICubridNode) element).getLabel());
DatabaseEditorConfig editorConfig = QueryOptions.getEditorConfig(database, false);
if (editorConfig != null && editorConfig.getDatabaseComment() != null && editorConfig.getDatabaseComment().length() > 0) {
sbLabel.append("(").append(editorConfig.getDatabaseComment()).append(")");
// [TOOLS-2425]Support shard broker
DatabaseInfo dbInfo = database.getDatabaseInfo();
if (dbInfo != null && dbInfo.isShard()) {
if (dbInfo.getShardQueryType() == DatabaseInfo.SHARD_QUERY_TYPE_ID) {
sbLabel.append("[SHARD-ID:").append(dbInfo.getCurrentShardId()).append("]");
} else {
sbLabel.append("[SHARD-VAL:").append(dbInfo.getCurrentShardVal()).append("]");
}
}
return sbLabel.toString();
}
}
return ((ICubridNode) element).getLabel();
} else if (element instanceof PendingUpdateAdapter) {
return Messages.msgLoading;
}
return element == null ? "" : element.toString();
}
Aggregations