use of org.eclipse.draw2d.Label in project cubrid-manager by CUBRID.
the class GraphPlanTooltipFigure method initTitle.
private void initTitle() {
title = new Label();
title.setLabelAlignment(PositionConstants.CENTER);
title.setTextAlignment(PositionConstants.CENTER);
title.setFont(bolderFont);
add(title);
}
use of org.eclipse.draw2d.Label in project dbeaver by serge-rider.
the class AttributePart method performDirectEdit.
protected void performDirectEdit() {
if (manager == null) {
ERDGraphicalViewer viewer = (ERDGraphicalViewer) getViewer();
ValidationMessageHandler handler = viewer.getValidationHandler();
Label l = getFigure();
ColumnNameTypeCellEditorValidator columnNameTypeCellEditorValidator = new ColumnNameTypeCellEditorValidator(handler);
manager = new ExtendedDirectEditManager(this, TextCellEditor.class, new LabelCellEditorLocator(l), l, columnNameTypeCellEditorValidator);
}
manager.show();
}
use of org.eclipse.draw2d.Label in project cubrid-manager by CUBRID.
the class BrokerDBListFigure method setDBList.
/**
* Set the database list to display
*
* @param list List<String>
*/
public void setDBList(List<String> list) {
//in case of concurrent modfiy exception
List<Label> copyedDatabases = new ArrayList<Label>();
copyedDatabases.addAll(this.databases);
for (Label label : copyedDatabases) {
if (!list.contains(label.getText())) {
remove(label);
databases.remove(label);
}
}
for (String name : list) {
if (nameExists(name)) {
continue;
}
Label label = new Label();
label.setLabelAlignment(PositionConstants.LEFT);
label.setText(name);
label.setToolTip(new Label());
setLabelHint(label, name);
label.setForegroundColor(ColorConstants.black);
label.setIcon(PNG_DATABASE);
label.setSize(getSize().width - SPACING_1, LABEL_HEIGHT);
add(label);
databases.add(label);
}
lastContentLocation.y = FIRST_CONTENT_Y;
for (Label lable : databases) {
lable.setLocation(new Point(getLocation().x + lastContentLocation.x, getLocation().y + lastContentLocation.y));
lastContentLocation.y = lastContentLocation.y + SPACING_1 + LABEL_HEIGHT;
}
//Auto change size with the client count.
if (lastContentLocation.y >= TOTAL_HEIGHT) {
setSize(TOTAL_WIDTH, lastContentLocation.y);
}
}
use of org.eclipse.draw2d.Label in project cubrid-manager by CUBRID.
the class ClientFigure method setClients.
/**
* Set the clients to display
*
* @param list List<String>
*/
public void setClients(List<String> list) {
//in case of concurrent modfiy exception
List<Label> copyedDatabases = new ArrayList<Label>();
copyedDatabases.addAll(this.clients);
for (Label label : copyedDatabases) {
if (!list.contains(label.getText())) {
remove(label);
clients.remove(label);
}
}
for (String name : list) {
if (nameExists(name)) {
continue;
}
Label label = new Label();
label.setLabelAlignment(PositionConstants.LEFT);
label.setText(name);
label.setToolTip(new Label());
setLabelHint(label, name);
label.setForegroundColor(ColorConstants.black);
label.setIcon(PNG_CLIENT);
label.setSize(getSize().width - SPACING_1, LABEL_HEIGHT);
add(label);
clients.add(label);
}
lastContentLocation.y = FIRST_CONTENT_Y;
for (Label lable : clients) {
lable.setLocation(new Point(getLocation().x + lastContentLocation.x, getLocation().y + lastContentLocation.y));
lastContentLocation.y = lastContentLocation.y + SPACING_1 + LABEL_HEIGHT;
}
//Auto change size with the client count.
if (lastContentLocation.y >= TOTAL_HEIGHT) {
setSize(TOTAL_WIDTH, lastContentLocation.y);
}
}
use of org.eclipse.draw2d.Label in project cubrid-manager by CUBRID.
the class MonitorChartFigure method initFigure.
/**
* Initialize figure.
*
*/
private void initFigure() {
this.setSize(FIGURE_WIDTH, FIGURE_HEIGHT);
Label tt = new Label();
this.setToolTip(tt);
}
Aggregations