Subversion Repositories XServices

Compare Revisions

Regard whitespace Rev 39 → Rev 185

/sbm4mylyn/branches/V2009R2-maintenance/src/net/brutex/mylyn/sbmconnector/ui/SBMRepositorySettingsPage.java
33,8 → 33,6
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
108,8 → 106,11
 
@Override
public boolean isPageComplete() {
if (table != null && table.getText().length() > 4) {
return super.isPageComplete();
if (table != null
&& table.getText().length() > 4
&& getUserName() != null
&& getUserName().length() > 0) {
return true;
}
return false;
}
/sbm4mylyn/branches/V2009R2-maintenance/src/net/brutex/mylyn/sbmconnector/ui/SBMRepositoryQueryPage.java
20,10 → 20,12
package net.brutex.mylyn.sbmconnector.ui;
 
import java.awt.Color;
import java.util.ArrayList;
 
import net.brutex.mylyn.sbmconnector.core.SBMRepositoryConnector;
import net.brutex.mylyn.sbmconnector.core.model.SBMField;
import net.brutex.mylyn.sbmconnector.core.model.SBMSystemFields;
import net.brutex.sbm.wsclient.ReportInfo;
 
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
47,12 → 49,21
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
 
public class SBMRepositoryQueryPage extends AbstractRepositoryQueryPage {
 
private Text sql_where_clause = null;
private Text query_title = null;
private Combo reportcombo = null;
private ReportInfo selectedReport = null;
 
public static String SQL_QUERY = "sql_where";
public static String SQL_QUERY_NAME = "name";
public static String REPORT = "report";
public static String REPORT_OR_QUERY = "-- use query --";
 
public SBMRepositoryQueryPage(String pageName, TaskRepository repository,
IRepositoryQuery query) {
super(pageName, repository, query);
65,8 → 76,9
if (getQueryTitle() != null) {
query.setSummary(getQueryTitle());
}
query.setAttribute("sql_where", sql_where_clause.getText());
query.setAttribute("name", query_title.getText());
query.setAttribute(SQL_QUERY, sql_where_clause.getText());
query.setAttribute(SQL_QUERY_NAME, query_title.getText());
query.setAttribute(REPORT, selectedReport.getReportUUID());
}
 
@Override
80,8 → 92,73
public void createControl(Composite arg0) {
Composite control = new Composite(arg0, SWT.BORDER);
control.setLayout(new GridLayout(2, false));
 
Label report_label = new Label(control, SWT.NONE);
reportcombo = new Combo(control, SWT.SINGLE | SWT.BORDER);
new Label(control, SWT.NONE).setText(" OR ");
new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
 
Label query_label = new Label(control, SWT.NONE);
query_label.setText("Query Name:");
 
report_label.setText("Report");
 
String solutionname = getTaskRepository().getProperty(
SBMRepositorySettingsPage.STRING_SOLUTIONTABLE);
 
try {
final java.util.List<ReportInfo> reportlist = SBMRepositoryConnector
.getClient(getTaskRepository()).getReportList(solutionname);
 
reportcombo.add(REPORT_OR_QUERY);
reportcombo.select(0);
for (ReportInfo report : reportlist) {
reportcombo.add(report.getReportName());
}
 
reportcombo.addListener(SWT.Selection, new Listener() {
 
@Override
public void handleEvent(Event arg0) {
if (reportcombo.getSelectionIndex() == 0) {
query_title.setEditable(true);
query_title.setEnabled(true);
sql_where_clause.setEditable(true);
sql_where_clause.setEnabled(true);
query_title.setText("");
} else {
query_title.setEditable(false);
query_title.setEnabled(false);
sql_where_clause.setEditable(false);
sql_where_clause.setEnabled(false);
query_title.setText(reportcombo.getText());
selectedReport = reportlist.get(reportcombo
.getSelectionIndex() - 1);
 
}
 
}
});
 
} catch (Exception e) {
}
/*
*
*
* table.addListener(SWT.Selection, new Listener() {
*
* @Override public void handleEvent(Event arg0) { // when the table has
* been changed // try to re-read the field list tableFieldList = "";
* tableFullFieldList = ""; try { SBMField[] fields =
* SBMRepositoryConnector.getClient(
* createTaskRepository()).getFields(table.getText()) .toArray(new
* SBMField[0]); fillList(list, fields); } catch (Exception e) { } if
* (getWizard() != null) { solutionTable = table.getText();
* getWizard().getContainer().updateButtons(); } }
*
* }); regenerateTables(); expander.setClient(control);
*/
 
query_title = new Text(control, SWT.BORDER);
if (getQuery() != null)
query_title.setText(getQuery().getAttribute("name"));
91,7 → 168,8
Label label_sql = new Label(control, SWT.NONE);
label_sql.setText("SQL where:");
sql_where_clause = new Text(control, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER);
sql_where_clause = new Text(control, SWT.MULTI | SWT.WRAP
| SWT.V_SCROLL | SWT.BORDER);
GridData gd = new GridData(300, 150);
gd.horizontalSpan = 2;
sql_where_clause.setLayoutData(gd);
98,8 → 176,8
if (getQuery() != null)
sql_where_clause.setText(getQuery().getAttribute("sql_where"));
 
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(
query_title);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
.applyTo(query_title);
Dialog.applyDialogFont(control);
setControl(control);
}