Skip to content
Snippets Groups Projects
Commit 89d40cdf authored by helene ortiz's avatar helene ortiz
Browse files

in16b crash (Thu 8 Jul 15:15:51 CEST 2021)

parent 3d7ead3c
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,8 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
// Create the title label
titleLabel = SWTWidgetFactory.getInstance().createLabel(titleAreaComposite, "", FontFactory.standardFontDataHeight, FontFactory.BOLD_STYLE);
titleLabel.setForeground(SWTColorFactory.getTabButtonTextColor());
addMouseListenerOnTitle();
if (addExtraLabelInTitle()) {
PContainer container = ((SWTPWidgetFactory)(PWidgetFactory.getInstance())).convertToPContainer(titleAreaComposite);
extraLabel = SWTPWidgetFactory.getInstance().createSimpleLabel(container, getExtraLabelTextKey(), FontFactory.standardFontDataHeight, FontFactory.STANDARD_STYLE);
......@@ -280,14 +281,14 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
toolBarFormData.top = new FormAttachment(minMaxIndicatorCanvas, 0, SWT.CENTER);
toolBarFormData.right = new FormAttachment(100, -Magnifier.getScaledValue(Constants.MIN_MAX_INDICATOR_X));
executionBarComposite.setLayoutData(toolBarFormData);
/*
checkExpressionCanvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
SWTImageUtils.drawScaledImage(event.gc, checkExpressionImage, 0, 0);
}
});
*/
*/
backgroundCanvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
......@@ -351,7 +352,7 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
formData.left = new FormAttachment(executionImageCanvas, Magnifier.getScaledValue(Constants.TITLE_SPACING_X));
titleLabel.setLayoutData(formData);
setTitleAreaCompositeLayoutData();
if (commandBox.needsToolBarParentContainer()) {
// Toolbar content
toolBarCompositeFormData = new FormData();
......@@ -375,7 +376,7 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
private void setToolBarCompositeLayoutData() {
toolBarCompositeFormData.top = new FormAttachment(controllerImageCanvas, 0, SWT.CENTER);
if (addExtraLabelInTitle()) {
toolBarCompositeFormData.left = new FormAttachment(((SWTSimpleLabel)extraLabel).getLabel(), Magnifier.getScaledValue(Constants.TITLE_SPACING_X) * 4);
} else {
......@@ -990,11 +991,11 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
@Override
public final void setFocus() {
// H.ORTIZ 17 JUN 2019
// Fix bug: if the user has selected the command box by a click on a text field which is not the first one,
// the focus goes however in the first text widget
//if (commandContentComposite.getChildren() != null && commandContentComposite.getChildren().length > 0) {
// commandContentComposite.getChildren()[0].setFocus();
//}
......@@ -1004,12 +1005,12 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
protected boolean addExtraLabelInTitle() {
return false;
}
protected Label getExtraLabel() {
return null;
}
protected String getExtraLabelTextKey() {
return "";
}
......@@ -1025,12 +1026,23 @@ public class SWTCommandBoxPeer extends CommandBoxPeer {
controllerImageCanvas.setToolTipText(ConfigManager.getInstance().getString("commandBoxGoToSettingsTooltip") + " " + commandBox.getName());
controllerImageCanvas.setCursor(SWTWidgetFactory.getInstance().getHandCursor());
}
protected void onControllerImageClick() {
MainWindow.getInstance().goToNode(SelectionPlugin.SETTINGS_ID, commandBox.getName());
}
protected void addMouseListenerOnTitle() {
titleLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
if (commandBox.isAtomic()) {
Nomad.displayMap(commandBox.getControllerCommandPlugin().getControllers());
}
}
});
}
/*
@Override
protected void redrawCheckExpressionImage() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment