/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMRepositorySettingsPage.java |
---|
0,0 → 1,91 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import net.brutex.mylyn.sbmconnector.SBMConnectorPlugin; |
import net.brutex.mylyn.sbmconnector.core.SBMClient; |
import org.eclipse.core.runtime.CoreException; |
import org.eclipse.core.runtime.IProgressMonitor; |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; |
import org.eclipse.swt.widgets.Composite; |
public class SBMRepositorySettingsPage extends AbstractRepositorySettingsPage { |
public SBMRepositorySettingsPage(String title, String description, |
TaskRepository taskRepository) { |
super(title, description, taskRepository); |
// TODO Auto-generated constructor stub |
} |
@Override |
protected void createAdditionalControls(Composite parent) { |
// TODO Auto-generated method stub |
} |
@Override |
public String getConnectorKind() { |
return SBMConnectorPlugin.CONNECTOR_KIND; |
} |
@Override |
protected Validator getValidator(TaskRepository repository) { |
return new SBMConnectionValidator(repository); |
} |
@Override |
protected boolean isValidUrl(String url) { |
if(url.contains("<server>")) return false; |
return true; |
} |
@Override |
protected void applyValidatorResult(Validator validator) { |
if (((SBMConnectionValidator) validator).getResult() != null) { |
getContainer().updateButtons(); |
} |
super.applyValidatorResult(validator); |
} |
protected class SBMConnectionValidator extends Validator { |
private TaskRepository repository; |
private String result = null; |
protected SBMConnectionValidator(TaskRepository repository) { |
this.repository = repository; |
} |
@Override |
public void run(IProgressMonitor monitor) throws CoreException { |
monitor.beginTask("Prüfe Verbindung", IProgressMonitor.UNKNOWN); |
SBMClient client = new SBMClient(repository); |
if(!client.canAuthenticate()) { |
result = "Verbindung fehlgeschlagen"; |
} |
result = "Verbindung erfolgreich"; |
monitor.done(); |
} |
public String getResult() { return result; } |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMTicketEditorPageFactory.java |
---|
0,0 → 1,72 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import net.brutex.mylyn.sbmconnector.SBMConnectorPlugin; |
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; |
import org.eclipse.mylyn.tasks.ui.TasksUiImages; |
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPageFactory; |
import org.eclipse.mylyn.tasks.ui.editors.BrowserFormPage; |
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; |
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; |
import org.eclipse.swt.graphics.Image; |
import org.eclipse.ui.forms.editor.IFormPage; |
public class SBMTicketEditorPageFactory extends AbstractTaskEditorPageFactory { |
@Override |
public boolean canCreatePageFor(TaskEditorInput input) { |
if (input.getTask().getConnectorKind().equals(SBMConnectorPlugin.CONNECTOR_KIND)) { |
return true; |
} |
return false; |
} |
@Override |
public IFormPage createPage(TaskEditor parentEditor) { |
TaskEditorInput input = parentEditor.getTaskEditorInput(); |
if (input.getTask().getConnectorKind().equals(SBMConnectorPlugin.CONNECTOR_KIND)) { |
SBMTicketEditorPage sbmeditor = new SBMTicketEditorPage(parentEditor); |
return sbmeditor; |
} else { |
return new BrowserFormPage(parentEditor, "Formular konnte nicht generiert werden"); |
} |
} |
@Override |
public Image getPageImage() { |
return CommonImages.getImage(TasksUiImages.REPOSITORY_SMALL); |
} |
@Override |
public String getPageText() { |
return SBMConnectorPlugin.LABEL; |
} |
@Override |
public int getPriority() { |
// be the first |
return PRIORITY_TASK; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMRepositoryQueryPage.java |
---|
0,0 → 1,105 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import net.brutex.mylyn.sbmconnector.core.SBMRepositoryConnector; |
import org.eclipse.jface.dialogs.Dialog; |
import org.eclipse.jface.layout.GridDataFactory; |
import org.eclipse.mylyn.tasks.core.IRepositoryQuery; |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage; |
import org.eclipse.swt.SWT; |
import org.eclipse.swt.layout.GridData; |
import org.eclipse.swt.layout.GridLayout; |
import org.eclipse.swt.widgets.Combo; |
import org.eclipse.swt.widgets.Composite; |
import org.eclipse.swt.widgets.Label; |
import org.eclipse.swt.widgets.Text; |
public class SBMRepositoryQueryPage extends AbstractRepositoryQueryPage { |
private Combo table = null; |
private Text sql_where_clause = null; |
private Text query_title = null; |
public SBMRepositoryQueryPage(String pageName, TaskRepository repository, |
IRepositoryQuery query) { |
super(pageName, repository, query); |
setTitle("SBM Query"); |
setDescription("Please specify table database name."); |
} |
@Override |
public void applyTo(IRepositoryQuery query) { |
if (getQueryTitle() != null) { |
query.setSummary(getQueryTitle()); |
} |
query.setAttribute("table", table.getText()); |
query.setAttribute("sql_where", sql_where_clause.getText()); |
query.setAttribute("name", query_title.getText()); |
} |
@Override |
public String getQueryTitle() { |
if(query_title!=null && !query_title.getText().isEmpty()) return query_title.getText(); |
return "new query"; |
} |
@Override |
public void createControl(Composite arg0) { |
Composite control = new Composite(arg0,SWT.BORDER); |
control.setLayout(new GridLayout(2, false)); |
Label query_label = new Label(control, SWT.NONE); |
query_label.setText("Query Name:"); |
query_title = new Text(control, SWT.BORDER); |
if(getQuery()!=null) query_title.setText(getQuery().getAttribute("name")); |
Label label = new Label(control, SWT.NONE); |
label.setText("Table:"); |
table = new Combo(control, SWT.SINGLE | SWT.BORDER); |
for(String table_name : SBMRepositoryConnector.getClient(getTaskRepository()).getPrimaryTables()) { |
table.add(table_name); |
if(getQuery()!=null && getQuery().getAttribute("table").equals(table_name)) { |
table.setText(table_name); |
} |
} |
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); |
if(getQuery()!=null) sql_where_clause.setText(getQuery().getAttribute("sql_where")); |
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(table); |
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(query_title); |
Dialog.applyDialogFont(control); |
setControl(control); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMTicketEditorPage.java |
---|
0,0 → 1,50 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import net.brutex.mylyn.sbmconnector.SBMConnectorPlugin; |
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; |
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; |
public class SBMTicketEditorPage extends AbstractTaskEditorPage { |
public SBMTicketEditorPage(TaskEditor editor) { |
super(editor, SBMConnectorPlugin.CONNECTOR_KIND); |
setNeedsPrivateSection(false); |
setNeedsSubmitButton(false); |
setNeedsSubmit(false); |
setNeedsSubmit(false); |
} |
/*@Override |
protected Set<TaskEditorPartDescriptor> createPartDescriptors() { |
Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors(); |
// remove unnecessary default editor parts |
//for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) { |
// if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)) { |
// descriptors.remove(taskEditorPartDescriptor); |
// break; |
// } |
//} |
return descriptors; |
}*/ |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMQueryComposite.java |
---|
0,0 → 1,50 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import org.eclipse.swt.layout.GridLayout; |
import org.eclipse.swt.graphics.Point; |
import org.eclipse.swt.widgets.Composite; |
import org.eclipse.swt.widgets.Label; |
import org.eclipse.swt.SWT; |
import org.eclipse.swt.widgets.Text; |
public class SBMQueryComposite extends Composite { |
private Label label = null; |
private Text table = null; |
private Text textArea = null; |
public SBMQueryComposite(Composite parent, int style) { |
super(parent, style); |
initialize(); |
} |
private void initialize() { |
GridLayout gridLayout = new GridLayout(); |
gridLayout.numColumns = 2; |
label = new Label(this, SWT.NONE); |
label.setText("Table:"); |
table = new Text(this, SWT.BORDER); |
textArea = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); |
this.setLayout(gridLayout); |
setSize(new Point(300, 200)); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/SBMRepositoryConnectorUi.java |
---|
0,0 → 1,71 |
/* |
* Mylyn Connector for Serena Business Mashups |
* Copyright 2010 Brian Rosenberger (Brutex Network) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
* |
* Serena, TeamTrack and Serena Business Mashup are |
* registered trademarks of SERENA Software Inc. |
*/ |
package net.brutex.mylyn.sbmconnector.ui; |
import net.brutex.mylyn.sbmconnector.SBMConnectorPlugin; |
import org.eclipse.jface.wizard.IWizard; |
import org.eclipse.mylyn.tasks.core.IRepositoryQuery; |
import org.eclipse.mylyn.tasks.core.ITaskMapping; |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; |
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage; |
import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard; |
public class SBMRepositoryConnectorUi extends AbstractRepositoryConnectorUi { |
@Override |
public String getConnectorKind() { |
return SBMConnectorPlugin.CONNECTOR_KIND; |
} |
@Override |
public IWizard getNewTaskWizard(TaskRepository taskRepository, |
ITaskMapping selection) { |
// TODO Auto-generated method stub |
return null; |
} |
@Override |
public IWizard getQueryWizard(TaskRepository taskRepository, |
IRepositoryQuery queryToEdit) { |
RepositoryQueryWizard w = new RepositoryQueryWizard(taskRepository); |
w.addPage(new SBMRepositoryQueryPage("Primary Table Specification", taskRepository, queryToEdit)); |
return w; |
} |
@Override |
public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository) { |
return new SBMRepositorySettingsPage(SBMConnectorPlugin.LABEL, |
SBMConnectorPlugin.DESCRIPTION, |
new TaskRepository(SBMConnectorPlugin.CONNECTOR_KIND, |
"http://<server>:80/gsoap/gsoap_ssl.dll?aewebservices71")); |
} |
@Override |
public boolean hasSearchPage() { |
// TODO Auto-generated method stub |
return false; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/ui/package.html |
---|
0,0 → 1,7 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
<html> |
<head></head> |
<body> |
Provides... |
</body> |
</html> |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |