Révision 3793

TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3793)
71 71
import org.txm.rcp.p2.plugins.TXMUpdateHandler;
72 72
import org.txm.rcp.perspective.TXMPerspective;
73 73
import org.txm.rcp.preferences.RCPPreferences;
74
import org.txm.rcp.swt.dialog.ImageOKCancelDialog;
74 75
import org.txm.rcp.utils.JobHandler;
75 76
import org.txm.rcp.utils.SWTEditorsUtils;
76 77
import org.txm.utils.BundleUtils;
......
232 233
						lockFile.createNewFile(); //$NON-NLS-1$
233 234

  
234 235
						String s = getVersionLevel();
235
						if ("stable".equals(RCPPreferences.getInstance().getString(RCPPreferences.UPDATE_LEVEL)) && s.length() == 0) {
236
						if ("STABLE".equals(RCPPreferences.getInstance().getString(RCPPreferences.UPDATE_LEVEL)) && s.length() == 0) {
236 237
							Log.info(TXMUIMessages.info_txmIsReady);
237 238
						} else {
238
							Log.warning("TXM is running in test mode. This mode is not intendend to be used to work.");
239
							String s2 = """
240
									You are using an ALPHA or BETA version of TXM to test and debug the software.
241
									It is not recommended to use it for your work.
242
									""";
243
							Log.warning(s2);
244
							
239 245
							if (Application.isHeadLess()) {
240 246

  
241 247
							} else if (org.eclipse.core.runtime.Platform.inDevelopmentMode()) {
......
250 256

  
251 257
									@Override
252 258
									public void run() {
253
										MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Test mode", "TXM is running in test mode. This mode is not intendend to be used to work.");
259
										//MessageDialog dialog = new MessageDialog(, MessageDialog.WARNING, 0);
260
										ImageOKCancelDialog dialog = new ImageOKCancelDialog(Display.getDefault().getActiveShell(), "Warning", IImageKeys.getImage(IImageKeys.WORKSITE), s2);
261
										if (dialog.open() == ImageOKCancelDialog.CANCEL) {
262
											System.exit(0);
263
										}
264
										//MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning", s2);
254 265
									}
255 266
								});
256 267
							}
......
968 979
			public void run() {
969 980
				try {
970 981
					System.out.println(getTXMStartMessage());
971
					if ("BETA".equals(RCPPreferences.getInstance().getString(RCPPreferences.UPDATE_LEVEL))) {
972
						System.out.println("WARNING: TXM IS CURRENTLY RUNNING IN TEST MODE.");
973
						System.out.println("*******  Change the update level to STABLE and remove the tested extension&updates if you need to work.");
974
					}
975

  
982
					
976 983
					// ensure some preferences are set
977 984
					DefaultScope.INSTANCE.getNode("org.eclipse.ui.workbench").putBoolean(IPreferenceConstants.RUN_IN_BACKGROUND, false); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
978 985
					DefaultScope.INSTANCE.getNode("org.eclipse.ui.workbench").flush(); //$NON-NLS-1$
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java (revision 3793)
270 270
	public static final String FILE_DOC = "icons/objects/file_doc.png"; //$NON-NLS-1$ ;
271 271

  
272 272
	public static final String HOME =  "icons/home.png"; //$NON-NLS-1$ ;
273

  
274
	public static final String WORKSITE = "icons/worksite.png";
273 275
	
274 276
	/**
275 277
	 * Gets the image.
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/ImageOKCancelDialog.java (revision 3793)
1
package org.txm.rcp.swt.dialog;
2

  
3
import org.eclipse.jface.dialogs.Dialog;
4
import org.eclipse.swt.SWT;
5
import org.eclipse.swt.graphics.Image;
6
import org.eclipse.swt.layout.GridData;
7
import org.eclipse.swt.layout.GridLayout;
8
import org.eclipse.swt.widgets.Composite;
9
import org.eclipse.swt.widgets.Control;
10
import org.eclipse.swt.widgets.Label;
11
import org.eclipse.swt.widgets.Shell;
12
import org.eclipse.swt.widgets.Text;
13

  
14
public class ImageOKCancelDialog extends Dialog {
15
	
16
	String title;
17
	Image image;
18
	String message;
19

  
20
	public ImageOKCancelDialog(Shell parent, String title, Image image, String message) {
21
		
22
		super(parent);
23
		
24
		this.setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.APPLICATION_MODAL);
25
		
26
		this.title = title;
27
		this.image = image;
28
		this.message = message;
29
	}
30

  
31
	/* (non-Javadoc)
32
	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
33
	 */
34
	@Override
35
	protected void configureShell(Shell newShell) {
36
		
37
		super.configureShell(newShell);
38
		
39
		newShell.setText(title);
40
		
41
		
42
	}
43

  
44
	/* (non-Javadoc)
45
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
46
	 */
47
	@Override
48
	protected Control createDialogArea(Composite p) {
49
		
50
		Object layout = p.getLayout();
51
		if (layout instanceof GridLayout) {
52
			GridLayout glayout = (GridLayout)layout;
53
			glayout.marginWidth = 5;
54
			glayout.marginTop = 5;
55
			glayout.verticalSpacing = 5;
56
		}
57
		
58
		Label imageLabel = new Label(p, SWT.NONE);
59
		imageLabel.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, true));
60
		imageLabel.setImage(image);
61
		
62
		Label messageLabel = new Label(p, SWT.NONE);
63
		imageLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
64
		messageLabel.setText(message);
65
		
66
		return p;
67
	}
68
}
0 69

  

Formats disponibles : Unified diff