Commit 74bcb8a5 authored by Adam Knapp's avatar Adam Knapp

Fixing incorrect parsing of hostname and port parameters (issue #420)

Some improvements of HostController tab's UI is also included
parent c5142ab0
......@@ -1005,8 +1005,8 @@ public final class CliExecutor extends BaseExecutor {
} else if (MTC_TERMINATED.equals(shortversion)) {
suspectedLastState = mcStateEnum.MC_ACTIVE;
} else if (successfulStartUpMatcher.reset(fastLine).matches()) {
mcHost = successfulStartUpMatcher.group(2);
mcPort = successfulStartUpMatcher.group(3);
mcHost = successfulStartUpMatcher.group(3);
mcPort = successfulStartUpMatcher.group(4);
suspectedLastState = mcStateEnum.MC_LISTENING;
} else if (fullSuccessfulStartUpMatcher.reset(shortversion).matches()) {
mcHost = fullSuccessfulStartUpMatcher.group(1);
......
......@@ -37,7 +37,9 @@ import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.window.Window;
......@@ -186,6 +188,23 @@ public final class HostControllersTab extends AbstractLaunchConfigurationTab {
}
});
hostViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
if (!event.getSelection().isEmpty()) {
editHostButton.setEnabled(true);
copyHostButton.setEnabled(true);
removeHostButton.setEnabled(true);
} else {
editHostButton.setEnabled(false);
copyHostButton.setEnabled(false);
removeHostButton.setEnabled(false);
}
}
});
for (int i = 0; i < HOST_TABLE_COLUMN_HEADERS.length; i++) {
tableLayout.addColumnData(hostTableColumnLayouts[i]);
final TableColumn tc = new TableColumn(table, SWT.NONE, i);
......@@ -217,6 +236,7 @@ public final class HostControllersTab extends AbstractLaunchConfigurationTab {
}
});
editHostButton = createPushButton(buttonComposite, "Edit...", null);
editHostButton.setEnabled(false);
editHostButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent event) {
......@@ -224,6 +244,7 @@ public final class HostControllersTab extends AbstractLaunchConfigurationTab {
}
});
copyHostButton = createPushButton(buttonComposite, "Copy...", null);
copyHostButton.setEnabled(false);
copyHostButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent event) {
......@@ -231,6 +252,7 @@ public final class HostControllersTab extends AbstractLaunchConfigurationTab {
}
});
removeHostButton = createPushButton(buttonComposite, "Remove...", null);
removeHostButton.setEnabled(false);
removeHostButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent event) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment