Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ae0cb505 authored by Chan Leduc's avatar Chan Leduc
Browse files

--Added classes for eclipse interface

parent 2938e7cd
No related branches found
No related tags found
No related merge requests found
Showing
with 1579 additions and 33 deletions
......@@ -26,6 +26,7 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
//import org.eclipse.ui.internal.WorkbenchWindow;
......@@ -63,7 +64,12 @@ public class AlignAction implements IWorkbenchWindowActionDelegate {
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
//MessageDialog.openInformation(
// window.getShell(),
// "Alignment Plug-in, Version 1.0.1",
// "Hello, UPDATED Eclipse world");
IViewPart view = (IViewPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(AlignView.ID);
try{
window.getActivePage().showView(AlignView.ID);
}
......
/*
* $Id: View.java 860 2008-10-17 07:43:35Z cleduc $
*
* Copyright (C) INRIA, 2007-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package fr.inrialpes.exmo.align.plugin.neontk;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import org.eclipse.swt.SWT;
public class AlignFormLayoutFactory {
public static final int DEFAULT_CLEAR_MARGIN = 10;
public static final int CONTROL_HORIZONTAL_INDENT = 3;
public static final int FORM_BODY_MARGIN_TOP = 12;
public static final int FORM_BODY_MARGIN_BOTTOM = 12;
public static final int FORM_BODY_MARGIN_LEFT = 6;
public static final int FORM_BODY_MARGIN_RIGHT = 6;
public static final int FORM_BODY_HORIZONTAL_SPACING = 8;
public static final int FORM_BODY_VERTICAL_SPACING = 5;
public static final int FORM_BODY_MARGIN_HEIGHT = 0;
public static final int FORM_BODY_MARGIN_WIDTH = 0;
public static final int SECTION_CLIENT_MARGIN_TOP = 10;
public static final int SECTION_CLIENT_MARGIN_BOTTOM = 10;
public static final int SECTION_CLIENT_MARGIN_LEFT = 6;
public static final int SECTION_CLIENT_MARGIN_RIGHT = 6;
public static final int SECTION_CLIENT_HORIZONTAL_SPACING = 8;
public static final int SECTION_CLIENT_VERTICAL_SPACING = 8;
public static final int SECTION_CLIENT_MARGIN_HEIGHT = 0;
public static final int SECTION_CLIENT_MARGIN_WIDTH = 0;
public static final int SECTION_HEADER_VERTICAL_SPACING = 6;
public static final int CLEAR_MARGIN_TOP = DEFAULT_CLEAR_MARGIN;
public static final int CLEAR_MARGIN_BOTTOM = DEFAULT_CLEAR_MARGIN;
public static final int CLEAR_MARGIN_LEFT = DEFAULT_CLEAR_MARGIN;
public static final int CLEAR_MARGIN_RIGHT = DEFAULT_CLEAR_MARGIN;
public static final int CLEAR_HORIZONTAL_SPACING = 8;
public static final int CLEAR_VERTICAL_SPACING = 8;
public static final int CLEAR_MARGIN_HEIGHT = 0;
public static final int CLEAR_MARGIN_WIDTH = 0;
public static final int FORM_PANE_MARGIN_TOP = 0;
public static final int FORM_PANE_MARGIN_BOTTOM = 0;
public static final int FORM_PANE_MARGIN_LEFT = 0;
public static final int FORM_PANE_MARGIN_RIGHT = 0;
public static final int FORM_PANE_HORIZONTAL_SPACING = FORM_BODY_HORIZONTAL_SPACING;
public static final int FORM_PANE_VERTICAL_SPACING = FORM_BODY_VERTICAL_SPACING;
public static final int FORM_PANE_MARGIN_HEIGHT = 0;
public static final int FORM_PANE_MARGIN_WIDTH = 0;
private AlignFormLayoutFactory() {
// empty implementation
}
//public static FillLayout createFormFillLayout( ) {
// FillLayout layout = new FillLayout();
// layout.type = SWT.VERTICAL;
// return layout;
//}
public static void configureLayout(Control c, FormAttachment left,
FormAttachment top, FormAttachment right, FormAttachment bottom) {
FormData fd = new FormData();
if (left != null) {
fd.left = left;
}
if (top != null) {
fd.top = top;
}
if (right != null) {
fd.right = right;
}
if (bottom != null) {
fd.bottom = bottom;
}
c.setLayoutData(fd);
}
public static GridLayout createFormGridLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
GridLayout layout = new GridLayout();
layout.marginHeight = FORM_BODY_MARGIN_HEIGHT;
layout.marginWidth = FORM_BODY_MARGIN_WIDTH;
layout.marginTop = FORM_BODY_MARGIN_TOP;
layout.marginBottom = FORM_BODY_MARGIN_BOTTOM;
layout.marginLeft = FORM_BODY_MARGIN_LEFT;
layout.marginRight = FORM_BODY_MARGIN_RIGHT;
layout.horizontalSpacing = FORM_BODY_HORIZONTAL_SPACING;
layout.verticalSpacing = FORM_BODY_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static GridLayout createClearGridLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
GridLayout layout = new GridLayout();
layout.marginHeight = CLEAR_MARGIN_HEIGHT;
layout.marginWidth = CLEAR_MARGIN_WIDTH;
layout.marginTop = CLEAR_MARGIN_TOP;
layout.marginBottom = CLEAR_MARGIN_BOTTOM;
layout.marginLeft = CLEAR_MARGIN_LEFT;
layout.marginRight = CLEAR_MARGIN_RIGHT;
layout.horizontalSpacing = CLEAR_HORIZONTAL_SPACING;
layout.verticalSpacing = CLEAR_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static TableWrapLayout createFormTableWrapLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
TableWrapLayout layout = new TableWrapLayout();
layout.topMargin = FORM_BODY_MARGIN_TOP;
layout.bottomMargin = FORM_BODY_MARGIN_BOTTOM;
layout.leftMargin = FORM_BODY_MARGIN_LEFT;
layout.rightMargin = FORM_BODY_MARGIN_RIGHT;
layout.horizontalSpacing = FORM_BODY_HORIZONTAL_SPACING;
layout.verticalSpacing = FORM_BODY_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static TableWrapLayout createFormPaneTableWrapLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
TableWrapLayout layout = new TableWrapLayout();
layout.topMargin = FORM_PANE_MARGIN_TOP;
layout.bottomMargin = FORM_PANE_MARGIN_BOTTOM;
layout.leftMargin = FORM_PANE_MARGIN_LEFT;
layout.rightMargin = FORM_PANE_MARGIN_RIGHT;
layout.horizontalSpacing = FORM_PANE_HORIZONTAL_SPACING;
layout.verticalSpacing = FORM_PANE_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static GridLayout createFormPaneGridLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
GridLayout layout = new GridLayout();
layout.marginHeight = FORM_PANE_MARGIN_HEIGHT;
layout.marginWidth = FORM_PANE_MARGIN_WIDTH;
layout.marginTop = FORM_PANE_MARGIN_TOP;
layout.marginBottom = FORM_PANE_MARGIN_BOTTOM;
layout.marginLeft = FORM_PANE_MARGIN_LEFT;
layout.marginRight = FORM_PANE_MARGIN_RIGHT;
layout.horizontalSpacing = FORM_PANE_HORIZONTAL_SPACING;
layout.verticalSpacing = FORM_PANE_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static TableWrapLayout createClearTableWrapLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
TableWrapLayout layout = new TableWrapLayout();
layout.topMargin = CLEAR_MARGIN_TOP;
layout.bottomMargin = CLEAR_MARGIN_BOTTOM;
layout.leftMargin = CLEAR_MARGIN_LEFT;
layout.rightMargin = CLEAR_MARGIN_RIGHT;
layout.horizontalSpacing = CLEAR_HORIZONTAL_SPACING;
layout.verticalSpacing = CLEAR_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static GridLayout createSectionClientGridLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
GridLayout layout = new GridLayout();
layout.marginHeight = SECTION_CLIENT_MARGIN_HEIGHT;
layout.marginWidth = SECTION_CLIENT_MARGIN_WIDTH;
layout.marginTop = SECTION_CLIENT_MARGIN_TOP;
layout.marginBottom = SECTION_CLIENT_MARGIN_BOTTOM;
layout.marginLeft = SECTION_CLIENT_MARGIN_LEFT;
layout.marginRight = SECTION_CLIENT_MARGIN_RIGHT;
layout.horizontalSpacing = SECTION_CLIENT_HORIZONTAL_SPACING;
layout.verticalSpacing = SECTION_CLIENT_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
public static TableWrapLayout createSectionClientTableWrapLayout( final boolean makeColumnsEqualWidth,
final int numColumns ) {
TableWrapLayout layout = new TableWrapLayout();
layout.topMargin = SECTION_CLIENT_MARGIN_TOP;
layout.bottomMargin = SECTION_CLIENT_MARGIN_BOTTOM;
layout.leftMargin = SECTION_CLIENT_MARGIN_LEFT;
layout.rightMargin = SECTION_CLIENT_MARGIN_RIGHT;
layout.horizontalSpacing = SECTION_CLIENT_HORIZONTAL_SPACING;
layout.verticalSpacing = SECTION_CLIENT_VERTICAL_SPACING;
layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
layout.numColumns = numColumns;
return layout;
}
}
\ No newline at end of file
/*
* $Id: View.java 860 2008-10-17 07:43:35Z cleduc $
*
* Copyright (C) INRIA, 2007-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package fr.inrialpes.exmo.align.plugin.neontk;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import fr.inrialpes.exmo.align.plugin.neontk.AlignFormLayoutFactory;
public class AlignFormSectionFactory {
private static Section gridExpandableSection;
private static Section simpleSection;
public static Composite createStaticSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns ) {
Section section;
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
SWT.WRAP );
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientTableWrapLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
public static Composite createHtmlSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle) {
Section section;
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE |
SWT.WRAP );
section.setText(sectionTitle);
Composite client = toolkit.createComposite( section );
section.setClient( client );
return client;
}
public static Composite createExpandableSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns,
final boolean isInitialyExpanded ) {
Section section;
if ( isInitialyExpanded ) {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE |
SWT.WRAP );
} else {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE );
}
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientTableWrapLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
public static Composite createGridStaticSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns ) {
Section section;
if (sectionDescription.length() > 0) {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
| SWT.WRAP);
section.setText(sectionTitle);
section.setDescription(sectionDescription);
} else {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR | SWT.WRAP);
section.setText(sectionTitle);
}
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientGridLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
public static Composite createGridExpandableSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns,
final boolean isInitialyExpanded ) {
Section section;
if ( isInitialyExpanded ) {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE |
SWT.WRAP );
} else {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE );
}
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
gridExpandableSection = section;
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientGridLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
public static Composite createGridExpandableSection(
final FormToolkit toolkit, final Composite parent,
final String sectionTitle, final int numOfColumns,
final boolean isInitialyExpanded) {
Section section;
if (isInitialyExpanded) {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR
| ExpandableComposite.TWISTIE | SWT.WRAP);
} else {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR
| ExpandableComposite.TWISTIE);
}
section.setText(sectionTitle);
toolkit.createCompositeSeparator(section);
section.setLayout(AlignFormLayoutFactory
.createClearTableWrapLayout(false, 1));
TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
section.setLayoutData(data);
gridExpandableSection = section;
Composite client = toolkit.createComposite(section);
client.setLayout(AlignFormLayoutFactory.createSectionClientGridLayout(false,
numOfColumns));
section.setClient(client);
return client;
}
public static Section getGridExpendableSection() {
return gridExpandableSection;
}
public static Section getSimpleSection() {
return simpleSection;
}
}
......@@ -21,7 +21,7 @@
package fr.inrialpes.exmo.align.plugin.neontk;
import org.eclipse.ui.plugin.*;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.BundleContext;
......
......@@ -35,11 +35,10 @@ import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.StringBuffer;
//mport javax.swing.JOptionPane;
import javax.swing.ProgressMonitorInputStream;
//import javax.swing.JComponent;
//import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.ProgressMonitor;
......@@ -313,6 +312,7 @@ public class OnlineAlign {
// Send message
answer = sendMessage( message, params );
//System.out.println("Answer get All :"+ answer);
}
catch ( Exception ex ) { ex.printStackTrace(); };
......@@ -1244,11 +1244,12 @@ public class OnlineAlign {
BufferedReader in = new BufferedReader(isr);
String line;
StringBuffer strBuff = new StringBuffer();
while ((line = in.readLine()) != null) {
answer += line + "\n";
strBuff.append( line + "\n");
}
if (in != null) in.close();
answer = strBuff.toString();
} catch (Exception ex) {
connected= false; ex.printStackTrace() ; return null;
......
/*
* $Id: View.java 860 2008-10-17 07:43:35Z cleduc $
*
* Copyright (C) INRIA, 2007-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package fr.inrialpes.exmo.align.plugin.neontk;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.SWT;
public class OnlineDialog extends Dialog {
private String message;
private String input;
public OnlineDialog(Shell parent) {
// Pass the default styles here
this(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL );
}
public OnlineDialog(Shell parent, int style) {
// Let users override the default styles
super(parent, style);
setText("Alignment Server");
setMessage("Please enter server URL:");
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
public String open() {
// Create the dialog window
Shell shell = new Shell(getParent(), getStyle());
shell.setText(getText());
createContents(shell);
shell.pack();
shell.open();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
// Return the entered value, or null
return input;
}
private void createContents(final Shell shell) {
shell.setLayout(new GridLayout(2, true));
// Show the message
Label label = new Label(shell, SWT.NONE);
label.setText(message);
GridData data = new GridData();
data.horizontalSpan = 6;
label.setLayoutData(data);
// Display the input box
final Text text = new Text(shell, SWT.BORDER);
text.setText("aserv.inrialpes.fr");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
text.setLayoutData(data);
// Create the OK button and add a handler
// so that pressing it will set input
// to the entered value
Button ok = new Button(shell, SWT.PUSH);
ok.setText("OK");
data = new GridData(GridData.FILL_HORIZONTAL);
ok.setLayoutData(data);
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
input = text.getText();
shell.close();
}
});
// Create the cancel button and add a handler
// so that pressing it will set input to null
Button cancel = new Button(shell, SWT.PUSH);
cancel.setText("Cancel");
data = new GridData(GridData.FILL_HORIZONTAL);
cancel.setLayoutData(data);
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
input = null;
shell.close();
}
});
// Set the OK button as the default, so
// user can type input and press Enter
// to dismiss
shell.setDefaultButton(ok);
}
}
......@@ -590,7 +590,7 @@ public class SWTInterface extends JPanel {
}
});
localAlignImportButton = new JButton("Export",null);
localAlignImportButton = new JButton("Import",null);
localAlignImportButton.setEnabled(false);
localAlignImportButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
......@@ -716,7 +716,7 @@ public class SWTInterface extends JPanel {
};
});
alignImportButton = new JButton("Export",null);
alignImportButton = new JButton("Import",null);
alignImportButton.setEnabled(false);
alignImportButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
......@@ -763,7 +763,7 @@ public class SWTInterface extends JPanel {
File file = new File(rdfPath);
AlignmentParser ap = new AlignmentParser(0);
ap.setEmbedded(true);
ap.setEmbedded( true );
align = (URIAlignment)ap.parse(file.toURI().toString());
SWTInterface.alignmentTable.put( alignKey , (Alignment)align );
......@@ -1201,9 +1201,7 @@ public class SWTInterface extends JPanel {
selectedLocalAlign = localAlignIdList[0];
//System.out.println("offline matching done. ");
//System.out.println("offline matching done. ");
} //else for ""offline"
} // getsource
......
/*
* $Id: View.java 860 2008-10-17 07:43:35Z cleduc $
*
* Copyright (C) INRIA, 2007-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package fr.inrialpes.exmo.align.plugin.neontk;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.SWT;
public class WSDialog extends Dialog {
private String message;
private String serverInput;
private String methodInput;
public WSDialog(Shell parent) {
// Pass the default styles here
this(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL );
}
public WSDialog(Shell parent, int style) {
// Let users override the default styles
super(parent, style);
setText("Parameters for matching");
setMessage("Parameters for matching");
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getServerInput() {
return serverInput;
}
public String getMethodInput() {
return methodInput;
}
public void setServerInput(String input) {
this.serverInput = input;
}
public void setMethodInput(String input) {
this.methodInput = input;
}
public String open() {
// Create the dialog window
Shell shell = new Shell(getParent(), getStyle());
shell.setText(getText());
createContents(shell);
shell.pack();
shell.open();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
// Return the entered value, or null
return serverInput;
}
private void createContents(final Shell shell) {
shell.setLayout(new GridLayout(3, true));
// Show the message
Label label = new Label(shell, SWT.NONE);
label.setText(message);
GridData data = new GridData();
data.horizontalSpan = 6;
label.setLayoutData(data);
// Display the input box for server
final Text server = new Text(shell, SWT.BORDER);
server.setText("http://kameleon.ijs.si/ontolight/ontolight.asmx");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 6;
server.setLayoutData(data);
// Display the input box for method
final Text wsmethod = new Text(shell, SWT.BORDER);
//text.setText("");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 6;
wsmethod.setLayoutData(data);
// Create the OK button and add a handler
// so that pressing it will set input
// to the entered value
Button ok = new Button(shell, SWT.PUSH);
ok.setText("OK");
data = new GridData(GridData.FILL_HORIZONTAL);
ok.setLayoutData(data);
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
serverInput = server.getText();
methodInput = wsmethod.getText();
shell.close();
}
});
// Create the cancel button and add a handler
// so that pressing it will set input to null
Button cancel = new Button(shell, SWT.PUSH);
cancel.setText("Cancel");
data = new GridData(GridData.FILL_HORIZONTAL);
cancel.setLayoutData(data);
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
serverInput = null;
methodInput = null;
shell.close();
}
});
// Set the OK button as the default, so
// user can type input and press Enter
// to dismiss
shell.setDefaultButton(ok);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment