Skip to content

Commit

Permalink
Small fixes to UI of TeiidView toolbar and SOAP Connection wizard
Browse files Browse the repository at this point in the history
* TeiidServerActionProvider
 * Changing selection in teiid view, repopulates the toolbar dropdown menu
   instead of constantly appending to it

* WSSoapProfile*WizardPage
 * Only when both wizard pages have been completed, is the finish button
   enabled.
  • Loading branch information
Paul Richardson committed Oct 12, 2012
1 parent 8cd1f36 commit cbc7ed6
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private void updateState() {
setPingButtonEnabled(true);

setErrorMessage(null);
setMessage(UTIL.getString("Click.Next.or.Finish")); //$NON-NLS-1$
setMessage(UTIL.getString("Click.Next")); //$NON-NLS-1$

// Reset the test status
testStatus = Status.OK_STATUS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ public void widgetDefaultSelected(SelectionEvent e) {
endPointCombo.setVisibleItemCount(10);
}

/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
*/
@Override
public void setVisible(boolean visible) {
if (visible == true && endPointCombo != null) {
Expand Down Expand Up @@ -171,6 +168,26 @@ public void run() {
super.setVisible(visible);
}

@Override
public boolean isPageComplete() {
String endPointName = profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
if (null == endPointName || endPointName.isEmpty()) {
return false;
}

String portURI = profileProperties.getProperty(IWSProfileConstants.END_POINT_URI_PROP_ID);
if (null == portURI || portURI.isEmpty()) {
return false;
}

String soapBinding = profileProperties.getProperty(IWSProfileConstants.SOAP_BINDING);
if (null == soapBinding || soapBinding.isEmpty()) {
return false;
}

return true;
}

private void updateState() {

String endPointName = profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ WSSoapProfileDetailsWizardPage.validationErrorWsdlMessage=Failed to validate the
WSSoapPropertyPage.endPointName=End Point
WSSoapPropertyPage.endPoint.ToolTip=The SOAP end point (or port) used by the server

Click.Next=Click Next
Click.Next.or.Finish=Click Next or Finish

WSWizardUtils.connectionFailureMessage=Failed to validate the WSDL connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ public class TeiidServerActionProvider extends CommonActionProvider {
private IAction showPreviewDataSourcesAction;

private IAction showTranslatorsAction;

private IAction enablePreviewAction;

private IMenuListener enablePreviewActionListener = new IMenuListener() {

@Override
public void menuAboutToShow( IMenuManager manager ) {
enablePreviewAction.setChecked(isPreviewEnabled());
}
};

private ISelectionProvider selectionProvider;

Expand Down Expand Up @@ -408,70 +418,65 @@ private void fillLocalToolBar( IToolBarManager manager ) {
}

private void fillLocalPullDown( IMenuManager menuMgr ) {
menuMgr.removeAll();
menuMgr.removeMenuListener(enablePreviewActionListener);

// add the show preview VDBs action
this.showPreviewVdbsAction = new Action(getString("showPreviewVdbsMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void run() {
toggleShowPreviewVdbs();
}
};

// restore state and add to menu
this.showPreviewVdbsAction.setChecked(this.showPreviewVdbs);
menuMgr.add(this.showPreviewVdbsAction);
if (showPreviewVdbsAction == null) {
showPreviewVdbsAction = new Action(getString("showPreviewVdbsMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void run() {
toggleShowPreviewVdbs();
}
};
}

// add the show translators action
this.showTranslatorsAction = new Action(getString("showTranslatorsMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void run() {
toggleShowTranslators();
}
};

// restore state and add to menu
this.showTranslatorsAction.setChecked(this.showTranslators);
menuMgr.add(this.showTranslatorsAction);

if (showTranslatorsAction == null) {
showTranslatorsAction = new Action(getString("showTranslatorsMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void run() {
toggleShowTranslators();
}
};
}

// add the show preview data sources action
this.showPreviewDataSourcesAction = new Action(
if (showPreviewDataSourcesAction == null) {
showPreviewDataSourcesAction = new Action(
getString("showPreviewDataSourcesMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void run() {
toggleShowPreviewDataSources();
}
};

// restore state and add to menu
this.showPreviewDataSourcesAction.setChecked(this.showPreviewDataSources);
menuMgr.add(this.showPreviewDataSourcesAction);

final IAction enablePreviewAction = new Action(
getString("enablePreviewMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.Action#setChecked(boolean)
*/
@Override
public void setChecked( boolean checked ) {
super.setChecked(checked);

if (checked != isPreviewEnabled()) {
DqpPlugin.getInstance().getPreferences().putBoolean(PreferenceConstants.PREVIEW_ENABLED, checked);
@Override
public void run() {
toggleShowPreviewDataSources();
}
}
};
};
}

menuMgr.add(enablePreviewAction);
showPreviewVdbsAction.setChecked(this.showPreviewVdbs);
showTranslatorsAction.setChecked(this.showTranslators);
showPreviewDataSourcesAction.setChecked(this.showPreviewDataSources);

if (enablePreviewAction == null) {
enablePreviewAction = new Action(
getString("enablePreviewMenuItem"), SWT.TOGGLE) { //$NON-NLS-1$
@Override
public void setChecked( boolean checked ) {
super.setChecked(checked);

if (checked != isPreviewEnabled()) {
DqpPlugin.getInstance().getPreferences().putBoolean(PreferenceConstants.PREVIEW_ENABLED, checked);
}
}
};
}

// before the menu shows set the state of the enable preview action
menuMgr.addMenuListener(new IMenuListener() {
menuMgr.addMenuListener(enablePreviewActionListener);

@Override
public void menuAboutToShow( IMenuManager manager ) {
enablePreviewAction.setChecked(isPreviewEnabled());
}
});
menuMgr.add(showPreviewVdbsAction);
menuMgr.add(showTranslatorsAction);
menuMgr.add(showPreviewDataSourcesAction);
menuMgr.add(enablePreviewAction);
}

/* (non-Javadoc)
Expand Down

0 comments on commit cbc7ed6

Please sign in to comment.