Révision 1532
| tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesEditor.java (revision 1532) | ||
|---|---|---|
| 83 | 83 |
|
| 84 | 84 |
this.maxPropertiesToDisplay.addSelectionListener(new ComputeSelectionListener(this)); |
| 85 | 85 |
|
| 86 |
Group editComposite = this.getTopToolbar().installGroup(PropertiesUIMessages.corpusProperties, PropertiesUIMessages.corpusProperties, IImageKeys.PENCIL, null, false); |
|
| 87 |
editComposite.setLayout(GLComposite.createDefaultLayout(3)); |
|
| 86 |
// Group editComposite = this.getTopToolbar().installGroup(PropertiesUIMessages.corpusProperties, PropertiesUIMessages.corpusProperties, IImageKeys.PENCIL, null, false); |
|
| 87 |
// editComposite.setLayout(GLComposite.createDefaultLayout(3)); |
|
| 88 |
// |
|
| 89 |
// Label nameLabel = new Label(editComposite, SWT.NONE); |
|
| 90 |
// nameLabel.setText(PropertiesUIMessages.displayedNameColon); |
|
| 91 |
// |
|
| 92 |
// nameText = new Text(editComposite, SWT.BORDER); |
|
| 93 |
// nameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); |
|
| 94 |
// nameSaveButton = new Button(editComposite, SWT.PUSH); |
|
| 95 |
// nameSaveButton.setText(PropertiesUIMessages.apply); |
|
| 96 |
// nameSaveButton.addSelectionListener(new SelectionListener() {
|
|
| 97 |
// @Override |
|
| 98 |
// public void widgetSelected(SelectionEvent e) {
|
|
| 99 |
// String newName = nameText.getText().trim(); |
|
| 100 |
// if (newName.length() > 0) {
|
|
| 101 |
// getResult().getCorpus().setUserName(newName); |
|
| 102 |
// CorporaView.refreshObject(getResult().getCorpus()); |
|
| 103 |
// } |
|
| 104 |
// } |
|
| 105 |
// |
|
| 106 |
// @Override |
|
| 107 |
// public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 108 |
// } |
|
| 109 |
// }); |
|
| 110 |
// |
|
| 111 |
// Label descLabel = new Label(editComposite, SWT.NONE); |
|
| 112 |
// descLabel.setText(PropertiesUIMessages.descriptionColon); |
|
| 113 |
// |
|
| 114 |
// descriptionText = new StyledText(editComposite, SWT.BORDER | SWT.V_SCROLL); |
|
| 115 |
// descriptionText.setLayoutData(GridDataFactory.fillDefaults().hint(400, 100).minSize(400, 100).span(1, 2).create()); |
|
| 116 |
// descriptionSaveButton = new Button(editComposite, SWT.PUSH); |
|
| 117 |
// descriptionSaveButton.setText(PropertiesUIMessages.apply); |
|
| 118 |
// descriptionSaveButton.addSelectionListener(new SelectionListener() {
|
|
| 119 |
// @Override |
|
| 120 |
// public void widgetSelected(SelectionEvent e) {
|
|
| 121 |
// String newDescription = descriptionText.getText().trim(); |
|
| 122 |
// if (newDescription.length() > 0) {
|
|
| 123 |
// getResult().getCorpus().setDescription(newDescription); |
|
| 124 |
// getResult().setDirty(); |
|
| 125 |
// compute(true); |
|
| 126 |
// } |
|
| 127 |
// } |
|
| 128 |
// |
|
| 129 |
// @Override |
|
| 130 |
// public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 131 |
// } |
|
| 132 |
// }); |
|
| 88 | 133 |
|
| 89 |
Label nameLabel = new Label(editComposite, SWT.NONE); |
|
| 90 |
nameLabel.setText(PropertiesUIMessages.displayedNameColon); |
|
| 91 |
|
|
| 92 |
nameText = new Text(editComposite, SWT.BORDER); |
|
| 93 |
nameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); |
|
| 94 |
nameSaveButton = new Button(editComposite, SWT.PUSH); |
|
| 95 |
nameSaveButton.setText(PropertiesUIMessages.apply); |
|
| 96 |
nameSaveButton.addSelectionListener(new SelectionListener() {
|
|
| 97 |
@Override |
|
| 98 |
public void widgetSelected(SelectionEvent e) {
|
|
| 99 |
String newName = nameText.getText().trim(); |
|
| 100 |
if (newName.length() > 0) {
|
|
| 101 |
getResult().getCorpus().setUserName(newName); |
|
| 102 |
CorporaView.refreshObject(getResult().getCorpus()); |
|
| 103 |
} |
|
| 104 |
} |
|
| 105 |
|
|
| 106 |
@Override |
|
| 107 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 108 |
} |
|
| 109 |
}); |
|
| 110 |
|
|
| 111 |
Label descLabel = new Label(editComposite, SWT.NONE); |
|
| 112 |
descLabel.setText(PropertiesUIMessages.descriptionColon); |
|
| 113 |
|
|
| 114 |
descriptionText = new StyledText(editComposite, SWT.BORDER | SWT.V_SCROLL); |
|
| 115 |
descriptionText.setLayoutData(GridDataFactory.fillDefaults().hint(400, 100).minSize(400, 100).span(1, 2).create()); |
|
| 116 |
descriptionSaveButton = new Button(editComposite, SWT.PUSH); |
|
| 117 |
descriptionSaveButton.setText(PropertiesUIMessages.apply); |
|
| 118 |
descriptionSaveButton.addSelectionListener(new SelectionListener() {
|
|
| 119 |
@Override |
|
| 120 |
public void widgetSelected(SelectionEvent e) {
|
|
| 121 |
String newDescription = descriptionText.getText().trim(); |
|
| 122 |
if (newDescription.length() > 0) {
|
|
| 123 |
getResult().getCorpus().setDescription(newDescription); |
|
| 124 |
getResult().setDirty(); |
|
| 125 |
compute(true); |
|
| 126 |
} |
|
| 127 |
} |
|
| 128 |
|
|
| 129 |
@Override |
|
| 130 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 131 |
} |
|
| 132 |
}); |
|
| 133 |
|
|
| 134 | 134 |
// browser |
| 135 | 135 |
GLComposite displayArea = this.getResultArea(); |
| 136 | 136 |
|
| ... | ... | |
| 146 | 146 |
} else {
|
| 147 | 147 |
Log.severe("Information HTML file doesn't exist."); //$NON-NLS-1$
|
| 148 | 148 |
} |
| 149 |
String n = getResult().getCorpus().getUserName(); |
|
| 150 |
if (n == null) |
|
| 151 |
n = getResult().getCorpus().getName(); |
|
| 152 |
nameText.setText(n); |
|
| 153 |
|
|
| 154 |
String d = getResult().getCorpus().getDescription(); |
|
| 155 |
if (d != null) {
|
|
| 156 |
descriptionText.setText(getResult().getCorpus().getDescription()); |
|
| 157 |
} |
|
| 149 |
// String n = getResult().getCorpus().getUserName();
|
|
| 150 |
// if (n == null)
|
|
| 151 |
// n = getResult().getCorpus().getName();
|
|
| 152 |
// nameText.setText(n);
|
|
| 153 |
// |
|
| 154 |
// String d = getResult().getCorpus().getDescription();
|
|
| 155 |
// if (d != null) {
|
|
| 156 |
// descriptionText.setText(getResult().getCorpus().getDescription());
|
|
| 157 |
// }
|
|
| 158 | 158 |
} |
| 159 | 159 |
|
| 160 | 160 |
@Override |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java (revision 1532) | ||
|---|---|---|
| 147 | 147 |
static public TXMWebBrowserEditor openfile(String filepath) {
|
| 148 | 148 |
return openfile(filepath, new File(filepath).getName()); |
| 149 | 149 |
} |
| 150 |
|
|
| 151 |
static public void openExternalBrowser(String url) {
|
|
| 152 |
try {
|
|
| 153 |
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("http://textometrie.ens-lyon.fr/spip.php?rubrique61"));
|
|
| 154 |
} catch (Exception e1) {
|
|
| 155 |
e1.printStackTrace(); |
|
| 156 |
} |
|
| 157 |
} |
|
| 150 | 158 |
|
| 151 | 159 |
/** |
| 152 | 160 |
* Open a file given a path in a Web editor. |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/CGUMessageDialog.java (revision 1532) | ||
|---|---|---|
| 1 | 1 |
package org.txm.rcp.swt.dialog; |
| 2 | 2 |
|
| 3 |
import java.net.MalformedURLException; |
|
| 4 |
import java.net.URL; |
|
| 5 |
|
|
| 3 | 6 |
import org.eclipse.jface.dialogs.Dialog; |
| 4 | 7 |
import org.eclipse.jface.layout.GridDataFactory; |
| 5 | 8 |
import org.eclipse.jface.window.Window; |
| 6 | 9 |
import org.eclipse.swt.SWT; |
| 10 |
import org.eclipse.swt.events.MouseEvent; |
|
| 11 |
import org.eclipse.swt.events.MouseListener; |
|
| 7 | 12 |
import org.eclipse.swt.events.SelectionEvent; |
| 8 | 13 |
import org.eclipse.swt.events.SelectionListener; |
| 14 |
import org.eclipse.swt.graphics.Color; |
|
| 15 |
import org.eclipse.swt.graphics.Cursor; |
|
| 9 | 16 |
import org.eclipse.swt.graphics.Image; |
| 17 |
import org.eclipse.swt.layout.GridData; |
|
| 18 |
import org.eclipse.swt.layout.RowLayout; |
|
| 10 | 19 |
import org.eclipse.swt.widgets.Button; |
| 11 | 20 |
import org.eclipse.swt.widgets.Composite; |
| 12 | 21 |
import org.eclipse.swt.widgets.Control; |
| 22 |
import org.eclipse.swt.widgets.Display; |
|
| 23 |
import org.eclipse.swt.widgets.Label; |
|
| 24 |
import org.eclipse.swt.widgets.Link; |
|
| 13 | 25 |
import org.eclipse.swt.widgets.Shell; |
| 26 |
import org.eclipse.ui.PartInitException; |
|
| 27 |
import org.eclipse.ui.PlatformUI; |
|
| 28 |
import org.txm.rcp.IImageKeys; |
|
| 29 |
import org.txm.rcp.commands.OpenBrowser; |
|
| 30 |
import org.txm.rcp.messages.TXMUIMessages; |
|
| 14 | 31 |
|
| 15 |
public class CGUMessageDialog extends HTMLMessageDialog {
|
|
| 32 |
public class CGUMessageDialog extends Dialog {
|
|
| 16 | 33 |
|
| 17 | 34 |
boolean checked = false; |
| 18 |
String checkMessage = null; |
|
| 35 |
|
|
| 19 | 36 |
Button checkMessageButton = null; |
| 20 | 37 |
|
| 21 |
public CGUMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, Image dialogImage, String checkMessage, String[] dialogButtonLabels, int defaultIndex) {
|
|
| 22 |
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImage, dialogButtonLabels, defaultIndex); |
|
| 38 |
protected CGUMessageDialog(Shell shell) {
|
|
| 39 |
super(shell); |
|
| 40 |
} |
|
| 23 | 41 |
|
| 24 |
this.checkMessage = checkMessage; |
|
| 42 |
protected void configureShell(Shell newShell) {
|
|
| 43 |
super.configureShell(newShell); |
|
| 44 |
newShell.setText(TXMUIMessages.termsOfService); |
|
| 45 |
|
|
| 25 | 46 |
} |
| 26 | 47 |
|
| 27 |
/** |
|
| 28 |
* Create the area the message will be shown in. |
|
| 29 |
* <p> |
|
| 30 |
* The parent composite is assumed to use GridLayout as its layout manager, |
|
| 31 |
* since the parent is typically the composite created in |
|
| 32 |
* {@link Dialog#createDialogArea}.
|
|
| 33 |
* </p> |
|
| 34 |
* <p> |
|
| 35 |
* <strong>Note:</strong> Clients are expected to call this method, otherwise |
|
| 36 |
* neither the icon nor the message will appear. |
|
| 37 |
* </p> |
|
| 38 |
* |
|
| 39 |
* @param composite |
|
| 40 |
* The composite to parent from. |
|
| 41 |
* @return Control |
|
| 42 |
*/ |
|
| 43 |
protected Control createMessageArea(Composite composite) {
|
|
| 44 |
super.createMessageArea(composite); |
|
| 48 |
public static void main(String[] args) {
|
|
| 49 |
CGUMessageDialog dialog = new CGUMessageDialog(Display.getDefault().getActiveShell()); |
|
| 50 |
/** |
|
| 51 |
* CGUMessageDialog dialog = new CGUMessageDialog(Display.getCurrent().getActiveShell(), |
|
| 52 |
TXMUIMessages.termsOfService, |
|
| 53 |
IImageKeys.getImage(IImageKeys.TXM_ICON), |
|
| 54 |
TXMUIMessages.infpSupTXMIsPublishedUnderTheGNUGPL2LicenseAmpltInfaHrefEqualshttpsColonwwwgnuorglicensesgpl20enhtmlSuphttpsColonwwwgnuorglicensesgpl20enhtmlInfaSupAmpgt, |
|
| 55 |
IImageKeys.getImage(IImageKeys.TXM), |
|
| 56 |
TXMUIMessages.iAcceptTheLicenceAndIUndertakeToCiteTXMForAcknowledgingMyUseOfTXMInMyResearchWorkSeeTheCitationSectionOfTheInfhttpColontextometrieenslyonfrspipphprubrique61SupPage, |
|
| 57 |
dialogButtonLabels, 0) {
|
|
| 58 |
}; |
|
| 59 |
*/ |
|
| 60 |
dialog.open(); |
|
| 61 |
} |
|
| 45 | 62 |
|
| 46 |
// create checkMessage |
|
| 47 |
if (checkMessage != null) {
|
|
| 48 |
checkMessageButton = new Button(composite, SWT.CHECK); |
|
| 49 |
checkMessageButton.setText(checkMessage); |
|
| 50 |
//System.out.println("set message: "+message);
|
|
| 51 |
GridDataFactory |
|
| 52 |
.fillDefaults() |
|
| 53 |
.align(SWT.FILL, SWT.BEGINNING) |
|
| 54 |
.grab(true, false) |
|
| 55 |
.span(2, 2) |
|
| 56 |
.applyTo(messageLabel); |
|
| 57 |
|
|
| 58 |
checkMessageButton.addSelectionListener(new SelectionListener() {
|
|
| 59 |
|
|
| 60 |
@Override |
|
| 61 |
public void widgetSelected(SelectionEvent e) {
|
|
| 62 |
getButton(Window.OK).setEnabled(checkMessageButton.getSelection()); |
|
| 63 |
} |
|
| 64 |
|
|
| 65 |
@Override |
|
| 66 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 67 |
}); |
|
| 68 |
} |
|
| 69 |
|
|
| 63 |
// protected Control createMessageArea(Composite composite) {
|
|
| 64 |
// super.createMessageArea(composite); |
|
| 65 |
// |
|
| 66 |
// // create checkMessage |
|
| 67 |
// if (checkMessage != null) {
|
|
| 68 |
// checkMessageButton = new Button(composite, SWT.CHECK); |
|
| 69 |
// checkMessageButton.setText(checkMessage); |
|
| 70 |
// //System.out.println("set message: "+message);
|
|
| 71 |
// GridDataFactory |
|
| 72 |
// .fillDefaults() |
|
| 73 |
// .align(SWT.FILL, SWT.BEGINNING) |
|
| 74 |
// .grab(true, false) |
|
| 75 |
// .span(2, 2) |
|
| 76 |
// .applyTo(messageLabel); |
|
| 77 |
// |
|
| 78 |
// checkMessageButton.addSelectionListener(new SelectionListener() {
|
|
| 79 |
// |
|
| 80 |
// @Override |
|
| 81 |
// public void widgetSelected(SelectionEvent e) {
|
|
| 82 |
// getButton(Window.OK).setEnabled(checkMessageButton.getSelection()); |
|
| 83 |
// } |
|
| 84 |
// |
|
| 85 |
// @Override |
|
| 86 |
// public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 87 |
// }); |
|
| 88 |
// } |
|
| 89 |
// |
|
| 90 |
// |
|
| 91 |
// return composite; |
|
| 92 |
// } |
|
| 93 |
// |
|
| 94 |
@Override |
|
| 95 |
protected Control createDialogArea(Composite parent) {
|
|
| 96 |
Control c = super.createDialogArea(parent); |
|
| 70 | 97 |
|
| 71 |
return composite; |
|
| 98 |
Display display = Display.getCurrent(); |
|
| 99 |
|
|
| 100 |
//new Label(messageComposite, SWT.NONE).setImage(IImageKeys.getImage(IImageKeys.TXM_ICON)); |
|
| 101 |
Label logo = new Label(parent, SWT.NONE); |
|
| 102 |
logo.setImage(new Image(display, "/home/mdecorde/workspace047/org.txm.rcp/icons/logo/TXM_logo_64x64.png")); |
|
| 103 |
logo.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false)); |
|
| 104 |
|
|
| 105 |
Composite messageComposite = new Composite(parent, SWT.NONE); |
|
| 106 |
messageComposite.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false)); |
|
| 107 |
messageComposite.setLayout(new RowLayout()); |
|
| 108 |
|
|
| 109 |
|
|
| 110 |
new Label(messageComposite, SWT.NONE).setText("TXM est diffusé sous licence ");
|
|
| 111 |
|
|
| 112 |
Label l = new Label(messageComposite, SWT.NONE); |
|
| 113 |
l.setText("GNU GPL 2");
|
|
| 114 |
l.setToolTipText("https://www.gnu.org/licenses/gpl-2.0.en.html");
|
|
| 115 |
l.addMouseListener(new MouseListener() {
|
|
| 116 |
|
|
| 117 |
@Override |
|
| 118 |
public void mouseUp(MouseEvent e) {
|
|
| 119 |
OpenBrowser.openExternalBrowser("https://www.gnu.org/licenses/gpl-2.0.en.html");
|
|
| 120 |
} |
|
| 121 |
|
|
| 122 |
@Override |
|
| 123 |
public void mouseDown(MouseEvent e) { }
|
|
| 124 |
|
|
| 125 |
@Override |
|
| 126 |
public void mouseDoubleClick(MouseEvent e) {}
|
|
| 127 |
}); |
|
| 128 |
|
|
| 129 |
Color blue = display.getSystemColor(SWT.COLOR_BLUE); |
|
| 130 |
Cursor cursor = display.getSystemCursor(SWT.CURSOR_HAND); |
|
| 131 |
l.setForeground(blue); |
|
| 132 |
l.setCursor(cursor); |
|
| 133 |
|
|
| 134 |
new Label(parent, SWT.NONE); |
|
| 135 |
|
|
| 136 |
checkMessageButton = new Button(parent, SWT.CHECK); |
|
| 137 |
checkMessageButton.setText("J'accepte la licence et je m'engage à citer TXM dans mes travaux de recherche.");
|
|
| 138 |
checkMessageButton.addSelectionListener(new SelectionListener() {
|
|
| 139 |
|
|
| 140 |
@Override |
|
| 141 |
public void widgetSelected(SelectionEvent e) {
|
|
| 142 |
getButton(Window.OK).setEnabled(checkMessageButton.getSelection()); |
|
| 143 |
} |
|
| 144 |
|
|
| 145 |
@Override |
|
| 146 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 147 |
}); |
|
| 148 |
|
|
| 149 |
Composite seeComposite = new Composite(parent, SWT.NONE); |
|
| 150 |
seeComposite.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false)); |
|
| 151 |
seeComposite.setLayout(new RowLayout()); |
|
| 152 |
|
|
| 153 |
new Label(seeComposite, SWT.NONE).setText("Voir la section 'Citation de TXM' de la page de ");
|
|
| 154 |
|
|
| 155 |
l = new Label(seeComposite, SWT.NONE); |
|
| 156 |
l.setText("Téléchargement");
|
|
| 157 |
l.setToolTipText("http://textometrie.ens-lyon.fr/spip.php?rubrique61");
|
|
| 158 |
l.setForeground(blue); |
|
| 159 |
l.setCursor(cursor); |
|
| 160 |
l.addMouseListener(new MouseListener() {
|
|
| 161 |
|
|
| 162 |
@Override |
|
| 163 |
public void mouseUp(MouseEvent e) { OpenBrowser.openExternalBrowser("http://textometrie.ens-lyon.fr/spip.php?rubrique61");}
|
|
| 164 |
|
|
| 165 |
@Override |
|
| 166 |
public void mouseDown(MouseEvent e) { }
|
|
| 167 |
|
|
| 168 |
@Override |
|
| 169 |
public void mouseDoubleClick(MouseEvent e) { }
|
|
| 170 |
}); |
|
| 171 |
|
|
| 172 |
return c; |
|
| 72 | 173 |
} |
| 73 |
|
|
| 74 |
protected void createDialogAndButtonArea(Composite parent) {
|
|
| 75 |
super.createDialogAndButtonArea(parent); |
|
| 174 |
|
|
| 175 |
@Override |
|
| 176 |
protected Control createButtonBar(Composite parent) {
|
|
| 177 |
Control c = super.createButtonBar(parent); |
|
| 76 | 178 |
getButton(Window.OK).setEnabled(false); |
| 179 |
return c; |
|
| 77 | 180 |
} |
| 78 | 181 |
|
| 79 | 182 |
/* |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 1532) | ||
|---|---|---|
| 190 | 190 |
//System.out.println("Opening CGU...");
|
| 191 | 191 |
//Display.getCurrent() works because this code is run during the splash screen |
| 192 | 192 |
String[] dialogButtonLabels = {"OK", "Cancel"};
|
| 193 |
CGUMessageDialog dialog = new CGUMessageDialog(Display.getCurrent().getActiveShell(), |
|
| 194 |
TXMUIMessages.termsOfService, |
|
| 195 |
IImageKeys.getImage(IImageKeys.TXM_ICON), |
|
| 196 |
TXMUIMessages.infpSupTXMIsPublishedUnderTheGNUGPL2LicenseAmpltInfaHrefEqualshttpsColonwwwgnuorglicensesgpl20enhtmlSuphttpsColonwwwgnuorglicensesgpl20enhtmlInfaSupAmpgt, |
|
| 197 |
IImageKeys.getImage(IImageKeys.TXM), |
|
| 198 |
TXMUIMessages.iAcceptTheLicenceAndIUndertakeToCiteTXMForAcknowledgingMyUseOfTXMInMyResearchWorkSeeTheCitationSectionOfTheInfhttpColontextometrieenslyonfrspipphprubrique61SupPage, |
|
| 199 |
dialogButtonLabels, 0) {
|
|
| 193 |
CGUMessageDialog dialog = new CGUMessageDialog(Display.getCurrent().getActiveShell()) {
|
|
| 200 | 194 |
}; |
| 201 | 195 |
boolean ret = (dialog.open() == MessageDialog.OK) && dialog.hasCheckBeenPressed(); |
| 202 | 196 |
if (ret) {
|
| ... | ... | |
| 333 | 327 |
String version = Activator.getDefault().getBundle().getVersion().toString(); // "0.7.7.201412160925"; |
| 334 | 328 |
version = version.replaceAll("(.\\..\\..)\\.(....)(..)(..)(..)(..)", "$1 ($2-$3-$4 $5h$6)"); //$NON-NLS-1$ //$NON-NLS-2$
|
| 335 | 329 |
System.out.print(NLS.bind(TXMUIMessages.startingUpP0, version)); |
| 336 |
DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
|
|
| 330 |
DateFormat formatter = TXMResult.PRETTY_LOCALIZED_TIME_FORMAT;
|
|
| 337 | 331 |
|
| 338 | 332 |
System.out.println(NLS.bind(" ({0})", formatter.format(new Date(Activator.getDefault().getBundle().getLastModified()))));
|
| 339 | 333 |
} |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameters.java (revision 1532) | ||
|---|---|---|
| 81 | 81 |
|
| 82 | 82 |
String extensions[] = {"*.parameters"}; //$NON-NLS-1$
|
| 83 | 83 |
dialog.setFilterExtensions(extensions); |
| 84 |
|
|
| 84 |
dialog.setFileName(((TXMResult)s).getValidFileName()+".parameters"); |
|
| 85 | 85 |
if (LastOpened.getFile(ID) != null) {
|
| 86 | 86 |
dialog.setFilterPath(LastOpened.getFolder(ID)); |
| 87 | 87 |
} |
| tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1532) | ||
|---|---|---|
| 12 | 12 |
import java.util.Date; |
| 13 | 13 |
import java.util.HashMap; |
| 14 | 14 |
import java.util.List; |
| 15 |
import java.util.Locale; |
|
| 15 | 16 |
import java.util.Properties; |
| 16 | 17 |
import java.util.concurrent.Semaphore; |
| 17 | 18 |
import java.util.regex.Pattern; |
| 18 | 19 |
|
| 19 | 20 |
import org.apache.commons.lang.StringUtils; |
| 20 |
import org.apache.xmlbeans.impl.common.IOUtil; |
|
| 21 | 21 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 22 | 22 |
import org.eclipse.core.runtime.Platform; |
| 23 | 23 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
| ... | ... | |
| 32 | 32 |
import org.txm.objects.Project; |
| 33 | 33 |
import org.txm.objects.Workspace; |
| 34 | 34 |
import org.txm.stat.utils.LogMonitor; |
| 35 |
import org.txm.utils.AsciiUtils; |
|
| 36 | 35 |
import org.txm.utils.io.IOUtils; |
| 37 | 36 |
import org.txm.utils.logger.Log; |
| 38 | 37 |
|
| ... | ... | |
| 73 | 72 |
|
| 74 | 73 |
public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMdd_HHmmssSSS");
|
| 75 | 74 |
public static final DateFormat PRETTY_TIME_FORMAT = new SimpleDateFormat("YYYY/MM/dd HH:mm:ss");
|
| 75 |
public static final DateFormat PRETTY_LOCALIZED_TIME_FORMAT = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault()); |
|
| 76 | 76 |
public static final String UUID_PREFIX = "txm_res_"; //$NON-NLS-1$ |
| 77 | 77 |
public static final Pattern FILE_NAME_PATTERN = Pattern.compile("[^a-zA-Z0-9\\.-]+"); //$NON-NLS-1$
|
| 78 | 78 |
public static final String UNDERSCORE = "_"; |
| tmp/org.txm.properties.core/src/org/txm/properties/core/messages/PropertiesCoreMessages.java (revision 1532) | ||
|---|---|---|
| 35 | 35 |
public static String numberOfWordProperties; |
| 36 | 36 |
public static String error_failedToAccessLexiconOfCorpusP0; |
| 37 | 37 |
public static String error_failedToAccessStructuresOfCorpusP0; |
| 38 |
|
|
| 39 |
public static String updatedTheP0; |
|
| 40 |
|
|
| 41 |
public static String createdTheP0; |
|
| 38 | 42 |
|
| 39 | 43 |
|
| 40 | 44 |
static {
|
| tmp/org.txm.properties.core/src/org/txm/properties/core/messages/messages.properties (revision 1532) | ||
|---|---|---|
| 14 | 14 |
error_failedToAccessStructuresOfCorpusP0=** Failed to access structures of the {0} corpus.
|
| 15 | 15 |
generalStatistics_2=Summary Statistics |
| 16 | 16 |
structuralUnitsProperties=<h3>Structures properties\n |
| 17 |
descriptionOf=Details of the corpus
|
|
| 17 |
descriptionOf=Properties of
|
|
| 18 | 18 |
error_failedToAccessPropertieOfCorpusP0=** Failed to access the properties of the {0} corpus.
|
| 19 | 19 |
lexicalUnitsPropertiesMaxP0Values=Lexical Units properties (max {0} values)
|
| 20 | 20 |
numberOfWordProperties=Number of word properties |
| 21 |
updatedTheP0=<p>Last update: {0}</p>
|
|
| 22 |
createdTheP0=<p>Creation date: {0}</p>
|
|
| tmp/org.txm.properties.core/src/org/txm/properties/core/messages/messages_fr.properties (revision 1532) | ||
|---|---|---|
| 14 | 14 |
error_failedToAccessStructuresOfCorpusP0=** Échec de l''accès aux structures du corpus {0}.
|
| 15 | 15 |
generalStatistics_2=Statistiques Générales |
| 16 | 16 |
structuralUnitsProperties=<h3>Propriétés des structures\n |
| 17 |
descriptionOf=Détails du corpus
|
|
| 17 |
descriptionOf=Propriétés de
|
|
| 18 | 18 |
error_failedToAccessPropertieOfCorpusP0=** Échec de l''accès aux propriétés du corpus {0}.
|
| 19 | 19 |
lexicalUnitsPropertiesMaxP0Values=Propriétés des unités lexicales (max {0} valeurs)
|
| 20 | 20 |
numberOfWordProperties=Nombre de propriétés de mot |
| 21 |
updatedTheP0=<p>Dernière modification : {0}.</p>
|
|
| 22 |
createdTheP0=<p>Date de création : {0}</p>
|
|
| tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java (revision 1532) | ||
|---|---|---|
| 287 | 287 |
"<body>\n"); //$NON-NLS-1$ |
| 288 | 288 |
buff.append("<h2 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.descriptionOf + this.corpus.getName() + " (id=" + this.corpus.getID() + ")</h2>\n"); //$NON-NLS-2$ //$NON-NLS-1$
|
| 289 | 289 |
|
| 290 |
if (this.corpus.getCreationDate() != null) {
|
|
| 291 |
buff.append(NLS.bind(PropertiesCoreMessages.createdTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(this.corpus.getCreationDate()))); |
|
| 292 |
} |
|
| 293 |
if (this.corpus.getLastComputingDate() != null) {
|
|
| 294 |
buff.append(NLS.bind(PropertiesCoreMessages.updatedTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(this.corpus.getLastComputingDate()))); |
|
| 295 |
} |
|
| 296 |
|
|
| 290 | 297 |
if (corpus.getDescription() != null && corpus.getDescription().length() > 0) {
|
| 291 |
buff.append("<p>" + corpus.getDescription() + "</p>"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
| 292 |
if (this.corpus.getCreationDate() != null) {
|
|
| 293 |
buff.append(NLS.bind("<p>Created the {0}</p>", TXMResult.PRETTY_TIME_FORMAT.format(this.corpus.getCreationDate())));
|
|
| 294 |
} |
|
| 295 |
if (this.corpus.getLastComputingDate() != null) {
|
|
| 296 |
buff.append(NLS.bind("<p>Imported the {0}</p>", TXMResult.PRETTY_TIME_FORMAT.format(this.corpus.getLastComputingDate())));
|
|
| 297 |
} |
|
| 298 |
buff.append("<p><h3>Description</h3>" + corpus.getDescription() + "</p>"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
| 298 | 299 |
} |
| 299 | 300 |
|
| 300 | 301 |
buff.append("<h3 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.generalStatistics_2 + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
Formats disponibles : Unified diff