Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Minor StatusMessageWidget changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed May 26, 2016
1 parent 1069c76 commit d6cad5e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public CommandInvocationEditor(CommonGetter<CommandInvocation> getDefaultCommand
commandInvocation.addChangeListener(this::updateWidgetFromInput);
}

public TextFieldWidget getButtonTextField() {
public TextFieldWidget getCommandArgumentsWidget() {
return commandArgumentsField;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ protected String newValueFromCommandVariablesDialog() throws OperationCancellati
}

protected void handleEditEnvironmentVars() {
Shell shell = getButtonTextField().getFieldControl().getShell();
Shell shell = getCommandArgumentsWidget().getFieldControl().getShell();

CommandInvocation cmd = getFieldValue();
EnvironmentSettings envSettings = new EnvironmentSettings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected void doUpdateWidgetFromInput() {

/* ----------------- ----------------- */

protected void setControlEnabled(Control control, boolean enabled) {
protected static void setControlEnabled(Control control, boolean enabled) {
SWTUtil.setEnabledIfOk(control, enabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

import melnorme.util.swt.SWTFactoryUtil;
import melnorme.util.swt.SWTUtil;
import melnorme.util.swt.components.AbstractWidget;
import melnorme.util.swt.components.AbstractDisableableWidget;
import melnorme.utilbox.status.IStatusMessage;
import melnorme.utilbox.status.IStatusMessage.StatusMessage;
import melnorme.utilbox.status.Severity;

public class StatusMessageWidget extends AbstractWidget {
public class StatusMessageWidget extends AbstractDisableableWidget {

protected Composite topControl;

Expand All @@ -45,7 +45,7 @@ public int getPreferredLayoutColumns() {

@Override
public void createComponentInlined(Composite parent) {
this.topControl = parent;
assertFail(); // not supported yet
}

@Override
Expand All @@ -56,8 +56,15 @@ protected void createContents(Composite topControl) {
null,
GridDataFactory.swtDefaults().create());

// Note: make sure we provide a minimum width hint, so label text doesn't take up one long line.
hintText = SWTFactoryUtil.createLink(topControl, SWT.LEFT, "",
GridDataFactory.fillDefaults().grab(true, false).create());
GridDataFactory.fillDefaults().hint(100, -1).grab(true, false).create());
}

@Override
protected void doSetEnabled(boolean enabled) {
setControlEnabled(icon, enabled);
setControlEnabled(hintText, enabled);
}

@Override
Expand Down

0 comments on commit d6cad5e

Please sign in to comment.