Search in sources :

Example 16 with Label

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);
}
Also used : Label(org.eclipse.draw2d.Label)

Example 17 with Label

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();
}
Also used : ExtendedDirectEditManager(org.jkiss.dbeaver.ext.erd.directedit.ExtendedDirectEditManager) LabelCellEditorLocator(org.jkiss.dbeaver.ext.erd.directedit.LabelCellEditorLocator) ValidationMessageHandler(org.jkiss.dbeaver.ext.erd.directedit.ValidationMessageHandler) Label(org.eclipse.draw2d.Label) EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) ERDGraphicalViewer(org.jkiss.dbeaver.ext.erd.editor.ERDGraphicalViewer) ColumnNameTypeCellEditorValidator(org.jkiss.dbeaver.ext.erd.directedit.ColumnNameTypeCellEditorValidator)

Example 18 with Label

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);
    }
}
Also used : ArrayList(java.util.ArrayList) Label(org.eclipse.draw2d.Label) Point(org.eclipse.draw2d.geometry.Point)

Example 19 with Label

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);
    }
}
Also used : ArrayList(java.util.ArrayList) Label(org.eclipse.draw2d.Label) Point(org.eclipse.draw2d.geometry.Point)

Example 20 with Label

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);
}
Also used : Label(org.eclipse.draw2d.Label)

Aggregations

Label (org.eclipse.draw2d.Label)56 IFigure (org.eclipse.draw2d.IFigure)8 Rectangle (org.eclipse.draw2d.geometry.Rectangle)8 Point (org.eclipse.draw2d.geometry.Point)7 LineBorder (org.eclipse.draw2d.LineBorder)6 WrapLabel (org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel)6 Image (org.eclipse.swt.graphics.Image)6 MouseEvent (org.eclipse.draw2d.MouseEvent)5 MouseListener (org.eclipse.draw2d.MouseListener)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Figure (org.eclipse.draw2d.Figure)4 RectangleFigure (org.eclipse.draw2d.RectangleFigure)4 Dimension (org.eclipse.draw2d.geometry.Dimension)4 PolylineConnection (org.eclipse.draw2d.PolylineConnection)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 EImage (org.talend.commons.ui.runtime.image.EImage)3 ComboCellLabel (org.talend.designer.gefabstractmap.figures.ComboCellLabel)3 RowBorder (org.talend.designer.gefabstractmap.figures.borders.RowBorder)3 CompoundBorder (org.eclipse.draw2d.CompoundBorder)2