Changeset 90:7ffeace6c47f
- Timestamp:
- 07/06/08 17:30:07
(5 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Update 3.4M7 to 3.4
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r71 |
r90 |
|
| 46 | 46 | import dwt.dwthelper.utils; |
|---|
| 47 | 47 | import tango.text.convert.Format; |
|---|
| | 48 | import tango.io.Stdout; |
|---|
| 48 | 49 | |
|---|
| 49 | 50 | /** |
|---|
| … | … | |
| 863 | 864 | } |
|---|
| 864 | 865 | |
|---|
| 865 | | return handler.isEnabled(); |
|---|
| | 866 | try { |
|---|
| | 867 | return handler.isEnabled(); |
|---|
| | 868 | } catch (Exception e) { |
|---|
| | 869 | if (DEBUG_HANDLERS) { |
|---|
| | 870 | // since this has the ability to generate megs of logs, only |
|---|
| | 871 | // provide information if tracing |
|---|
| | 872 | Tracing.printTrace("HANDLERS", "Handler " ~ (cast(Object)handler).toString() ~ " for " //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
|---|
| | 873 | ~ id ~ " threw unexpected exception"); //$NON-NLS-1$ |
|---|
| | 874 | ExceptionPrintStackTrace( e, Stdout ); |
|---|
| | 875 | } |
|---|
| | 876 | } |
|---|
| | 877 | return false; |
|---|
| 866 | 878 | } |
|---|
| 867 | 879 | |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2004, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2004, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2004, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2004, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| r72 |
r90 |
|
| 19 | 19 | import dwt.dwthelper.utils; |
|---|
| 20 | 20 | |
|---|
| 21 | | import tango.io.FileConst; |
|---|
| | 21 | import tango.io.model.IFile; |
|---|
| 22 | 22 | |
|---|
| 23 | 23 | static import tango.text.Text; |
|---|
| r43 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 24 | 24 | * This class is not intended to be subclassed outside the framework. |
|---|
| 25 | 25 | * </p> |
|---|
| | 26 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 26 | 27 | */ |
|---|
| 27 | 28 | public abstract class AbstractGroupMarker : ContributionItem { |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 60 | 60 | * This class may be instantiated; it is not intended to be subclassed. |
|---|
| 61 | 61 | * </p> |
|---|
| | 62 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 62 | 63 | */ |
|---|
| 63 | 64 | public class ActionContributionItem : ContributionItem { |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2003, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2003, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 437 | 437 | } |
|---|
| 438 | 438 | |
|---|
| | 439 | /** |
|---|
| | 440 | * @since 3.4 |
|---|
| | 441 | */ |
|---|
| 439 | 442 | public void preExecute(IAction action, Event event) { |
|---|
| 440 | 443 | String actionDefinitionId = action.getActionDefinitionId(); |
|---|
| … | … | |
| 450 | 453 | } |
|---|
| 451 | 454 | |
|---|
| | 455 | /** |
|---|
| | 456 | * @since 3.4 |
|---|
| | 457 | */ |
|---|
| 452 | 458 | public void postExecuteSuccess(IAction action, Object returnValue) { |
|---|
| 453 | 459 | String actionDefinitionId = action.getActionDefinitionId(); |
|---|
| … | … | |
| 459 | 465 | } |
|---|
| 460 | 466 | |
|---|
| | 467 | /** |
|---|
| | 468 | * @since 3.4 |
|---|
| | 469 | */ |
|---|
| 461 | 470 | public void postExecuteFailure(IAction action, |
|---|
| 462 | 471 | ExecutionException exception) { |
|---|
| … | … | |
| 469 | 478 | } |
|---|
| 470 | 479 | |
|---|
| | 480 | /** |
|---|
| | 481 | * @since 3.4 |
|---|
| | 482 | */ |
|---|
| 471 | 483 | public void notDefined(IAction action, NotDefinedException exception) { |
|---|
| 472 | 484 | String actionDefinitionId = action.getActionDefinitionId(); |
|---|
| … | … | |
| 478 | 490 | } |
|---|
| 479 | 491 | |
|---|
| | 492 | /** |
|---|
| | 493 | * @since 3.4 |
|---|
| | 494 | */ |
|---|
| 480 | 495 | public void notEnabled(IAction action, NotEnabledException exception) { |
|---|
| 481 | 496 | String actionDefinitionId = action.getActionDefinitionId(); |
|---|
| r43 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 27 | 27 | * subclassed outside the framework. |
|---|
| 28 | 28 | * </p> |
|---|
| | 29 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 29 | 30 | */ |
|---|
| 30 | 31 | public class GroupMarker : AbstractGroupMarker { |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 46 | 46 | * |
|---|
| 47 | 47 | * @see Action |
|---|
| | 48 | * @noimplement This interface is not intended to be implemented by clients. |
|---|
| 48 | 49 | */ |
|---|
| 49 | 50 | public interface IAction { |
|---|
| r16 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 42 | 42 | * |
|---|
| 43 | 43 | * @see IContributionManager |
|---|
| | 44 | * @noimplement This interface is not intended to be implemented by clients. |
|---|
| 44 | 45 | */ |
|---|
| 45 | 46 | public interface IContributionItem { |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| r70 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 27 | 27 | * |
|---|
| 28 | 28 | * @since 2.0 |
|---|
| | 29 | * @noimplement This interface is not intended to be implemented by clients. |
|---|
| 29 | 30 | */ |
|---|
| 30 | 31 | public interface IContributionManagerOverrides { |
|---|
| r28 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 32 | 32 | * {@link MenuManager <code>MenuManager</code>}. |
|---|
| 33 | 33 | * </p> |
|---|
| | 34 | * @noimplement This interface is not intended to be implemented by clients. |
|---|
| 34 | 35 | */ |
|---|
| 35 | 36 | public interface IMenuManager : IContributionManager, IContributionItem { |
|---|
| r71 |
r90 |
|
| 610 | 610 | * @return <code>true</code> if the control is created |
|---|
| 611 | 611 | * and not disposed, <code>false</code> otherwise |
|---|
| | 612 | * @since 3.4 protected, was added in 3.1 as private method |
|---|
| 612 | 613 | */ |
|---|
| 613 | 614 | protected bool menuExist() { |
|---|
| r43 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 32 | 32 | * subclassed outside the framework. |
|---|
| 33 | 33 | * </p> |
|---|
| | 34 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 34 | 35 | */ |
|---|
| 35 | 36 | public class Separator : AbstractGroupMarker { |
|---|
| r16 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 30 | 30 | * This class is not intended to be subclassed. |
|---|
| 31 | 31 | * </p> |
|---|
| | 32 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 32 | 33 | */ |
|---|
| 33 | 34 | public class SubContributionItem : IContributionItem { |
|---|
| r43 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 60 | 60 | * |
|---|
| 61 | 61 | * @since 3.0 |
|---|
| | 62 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 62 | 63 | */ |
|---|
| 63 | 64 | public class ToolBarContributionItem : ContributionItem, IToolBarContributionItem { |
|---|
| r71 |
r90 |
|
| 1282 | 1282 | * @param command |
|---|
| 1283 | 1283 | * @return |
|---|
| 1284 | | * blah |
|---|
| | 1284 | * a trigger sequence, or <code>null</code> |
|---|
| | 1285 | * @since 3.4 |
|---|
| 1285 | 1286 | */ |
|---|
| 1286 | 1287 | public final TriggerSequence getBestActiveBindingFor(ParameterizedCommand command) { |
|---|
| r40 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 64 | 64 | * </code> |
|---|
| 65 | 65 | * </pre> |
|---|
| | 66 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 66 | 67 | */ |
|---|
| 67 | 68 | |
|---|
| r72 |
r90 |
|
| 295 | 295 | * Image registry key for menu image. |
|---|
| 296 | 296 | * |
|---|
| 297 | | * @since 3.3 |
|---|
| | 297 | * @since 3.4 |
|---|
| 298 | 298 | */ |
|---|
| 299 | 299 | public static const String POPUP_IMG_MENU = "popup_menu_image"; //$NON-NLS-1$ |
|---|
| … | … | |
| 302 | 302 | * Image registry key for disabled menu image. |
|---|
| 303 | 303 | * |
|---|
| 304 | | * @since 3.3 |
|---|
| | 304 | * @since 3.4 |
|---|
| 305 | 305 | */ |
|---|
| 306 | 306 | public static const String POPUP_IMG_MENU_DISABLED = "popup_menu_image_diabled"; //$NON-NLS-1$ |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2005, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2005, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 133 | 133 | } |
|---|
| 134 | 134 | |
|---|
| 135 | | /* |
|---|
| 136 | | * (non-Javadoc) |
|---|
| 137 | | * |
|---|
| | 135 | /** |
|---|
| 138 | 136 | * @see dwtx.jface.fieldassist.IControlContentAdapter2#getSelection(dwt.widgets.Control) |
|---|
| 139 | 137 | * |
|---|
| … | … | |
| 144 | 142 | } |
|---|
| 145 | 143 | |
|---|
| 146 | | /* |
|---|
| 147 | | * (non-Javadoc) |
|---|
| 148 | | * |
|---|
| | 144 | /** |
|---|
| 149 | 145 | * @see dwtx.jface.fieldassist.IControlContentAdapter2#setSelection(dwt.widgets.Control, |
|---|
| 150 | 146 | * dwt.graphics.Point) |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2005, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2005, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 105 | 105 | } |
|---|
| 106 | 106 | |
|---|
| 107 | | /* |
|---|
| 108 | | * (non-Javadoc) |
|---|
| 109 | | * |
|---|
| | 107 | /** |
|---|
| 110 | 108 | * @see dwtx.jface.fieldassist.IControlContentAdapter2#getSelection(dwt.widgets.Control) |
|---|
| 111 | 109 | * |
|---|
| … | … | |
| 116 | 114 | } |
|---|
| 117 | 115 | |
|---|
| 118 | | /* |
|---|
| 119 | | * (non-Javadoc) |
|---|
| 120 | | * |
|---|
| | 116 | /** |
|---|
| 121 | 117 | * @see dwtx.jface.fieldassist.IControlContentAdapter2#setSelection(dwt.widgets.Control, |
|---|
| 122 | 118 | * dwt.graphics.Point) |
|---|
| r72 |
r90 |
|
| 205 | 205 | |
|---|
| 206 | 206 | table = new Table(composite, DWT.BORDER | DWT.SINGLE | DWT.V_SCROLL |
|---|
| 207 | | | DWT.H_SCROLL | DWT.FULL_SELECTION /* |
|---|
| | 207 | | DWT.H_SCROLL /* |
|---|
| 208 | 208 | * | DWT.CHECK |
|---|
| 209 | 209 | */); |
|---|
| … | … | |
| 281 | 281 | }); |
|---|
| 282 | 282 | |
|---|
| | 283 | Dialog.applyDialogFont(composite); |
|---|
| | 284 | |
|---|
| 283 | 285 | return composite; |
|---|
| 284 | 286 | } |
|---|
| r72 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 41 | 41 | * This class is not intended to be subclassed. |
|---|
| 42 | 42 | * </p> |
|---|
| | 43 | * @noinstantiate This class is not intended to be instantiated by clients. |
|---|
| | 44 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 43 | 45 | */ |
|---|
| 44 | 46 | public class ModalContext { |
|---|
| r50 |
r90 |
|
| 16 | 16 | |
|---|
| 17 | 17 | import tango.io.FilePath; |
|---|
| 18 | | import tango.io.FileConst; |
|---|
| | 18 | import tango.io.model.IFile; |
|---|
| 19 | 19 | // import java.util.ArrayList; |
|---|
| 20 | 20 | // import java.util.StringTokenizer; |
|---|
| r34 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 48 | 48 | * </p> |
|---|
| 49 | 49 | * Note: touching this class has the side effect of creating a display (static initializer). |
|---|
| | 50 | * @noinstantiate This class is not intended to be instantiated by clients. |
|---|
| 50 | 51 | */ |
|---|
| 51 | 52 | public class PreferenceConverter { |
|---|
| r72 |
r90 |
|
| 738 | 738 | Object selection = cast(Object) getSingleSelection(event.getSelection()); |
|---|
| 739 | 739 | if (cast(IPreferenceNode)selection ) { |
|---|
| 740 | | if (!isCurrentPageValid()) { |
|---|
| 741 | | handleError(); |
|---|
| 742 | | } else if (!showPage(cast(IPreferenceNode) selection)) { |
|---|
| 743 | | // Page flipping wasn't successful |
|---|
| 744 | | handleError(); |
|---|
| 745 | | } else { |
|---|
| 746 | | // Everything went well |
|---|
| 747 | | lastSuccessfulNode = cast(IPreferenceNode) selection; |
|---|
| 748 | | } |
|---|
| | 740 | BusyIndicator.showWhile(getShell().getDisplay(), new class(selection) Runnable { |
|---|
| | 741 | Object selection_; |
|---|
| | 742 | this(Object o){ selection_=o; } |
|---|
| | 743 | public void run() { |
|---|
| | 744 | if (!isCurrentPageValid()) { |
|---|
| | 745 | handleError(); |
|---|
| | 746 | } else if (!showPage(cast(IPreferenceNode) selection_)) { |
|---|
| | 747 | // Page flipping wasn't successful |
|---|
| | 748 | handleError(); |
|---|
| | 749 | } else { |
|---|
| | 750 | // Everything went well |
|---|
| | 751 | lastSuccessfulNode = cast(IPreferenceNode) selection_; |
|---|
| | 752 | } |
|---|
| | 753 | } |
|---|
| | 754 | }); |
|---|
| 749 | 755 | } |
|---|
| 750 | 756 | } |
|---|
| r47 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2006 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 299 | 299 | * |
|---|
| 300 | 300 | * @see IPreferenceStore |
|---|
| | 301 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 301 | 302 | */ |
|---|
| 302 | 303 | public class PreferenceStore : EventManager, |
|---|
| r78 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2003, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2003, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 52 | 52 | * |
|---|
| 53 | 53 | * @since 3.0 |
|---|
| | 54 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 54 | 55 | */ |
|---|
| 55 | 56 | public class ColorRegistry : ResourceRegistry { |
|---|
| … | … | |
| 106 | 107 | } |
|---|
| 107 | 108 | |
|---|
| | 109 | private final bool cleanOnDisplayDisposal; |
|---|
| | 110 | |
|---|
| 108 | 111 | /** |
|---|
| 109 | 112 | * Create a new instance of the receiver that is hooked to the current |
|---|
| … | … | |
| 142 | 145 | Assert.isNotNull(display); |
|---|
| 143 | 146 | this.display = display; |
|---|
| | 147 | this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; |
|---|
| 144 | 148 | if (cleanOnDisplayDisposal) { |
|---|
| 145 | 149 | hookDisplayDispose(); |
|---|
| … | … | |
| 156 | 160 | */ |
|---|
| 157 | 161 | private Color createColor(RGB rgb) { |
|---|
| | 162 | if (this.display is null) { |
|---|
| | 163 | Display display = Display.getCurrent(); |
|---|
| | 164 | if (display is null) { |
|---|
| | 165 | throw new IllegalStateException(); |
|---|
| | 166 | } |
|---|
| | 167 | this.display = display; |
|---|
| | 168 | if (cleanOnDisplayDisposal) { |
|---|
| | 169 | hookDisplayDispose(); |
|---|
| | 170 | } |
|---|
| | 171 | } |
|---|
| 158 | 172 | return new Color(display, rgb); |
|---|
| 159 | 173 | } |
|---|
| … | … | |
| 276 | 290 | stringToColor.clear(); |
|---|
| 277 | 291 | staleColors.clear(); |
|---|
| | 292 | display = null; |
|---|
| 278 | 293 | } |
|---|
| 279 | 294 | |
|---|
| r73 |
r90 |
|
| 26 | 26 | import dwt.graphics.Image; |
|---|
| 27 | 27 | import dwt.graphics.ImageData; |
|---|
| 28 | | import dwtx.core.runtime.Path; |
|---|
| | 28 | // import dwtx.core.runtime.FileLocator; |
|---|
| | 29 | // import dwtx.core.runtime.Path; |
|---|
| 29 | 30 | |
|---|
| 30 | 31 | import dwt.dwthelper.utils; |
|---|
| … | … | |
| 222 | 223 | // if (resource is null) |
|---|
| 223 | 224 | // return null; |
|---|
| 224 | | // try { |
|---|
| 225 | | // if (JFaceActivator.getBundleContext() is null) {// Stand-alone case |
|---|
| | 225 | // try { |
|---|
| | 226 | // if (JFaceActivator.getBundleContext() is null) {// Stand-alone case |
|---|
| 226 | 227 | // |
|---|
| 227 | | // return new Path(resource.getFile()).toOSString(); |
|---|
| 228 | | // } |
|---|
| 229 | | // return new Path(FileLocator.toFileURL(resource).getPath()).toOSString(); |
|---|
| | 228 | // return new Path(resource.getFile()).toOSString(); |
|---|
| | 229 | // } |
|---|
| | 230 | // return new Path(FileLocator.toFileURL(resource).getPath()).toOSString(); |
|---|
| | 231 | // } catch (IOException e) { |
|---|
| | 232 | // Policy.logException(e); |
|---|
| 230 | 233 | return null; |
|---|
| 231 | | // } catch (IOException e) { |
|---|
| 232 | | // Policy.logException(e); |
|---|
| 233 | | // return null; |
|---|
| 234 | | // } |
|---|
| | 234 | // } |
|---|
| 235 | 235 | } |
|---|
| 236 | 236 | } |
|---|
| r63 |
r90 |
|
| 1 | 1 | /******************************************************************************* |
|---|
| 2 | | * Copyright (c) 2000, 2007 IBM Corporation and others. |
|---|
| | 2 | * Copyright (c) 2000, 2008 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| 4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
|---|
| … | … | |
| 71 | 71 | * |
|---|
| 72 | 72 | * Since 3.0 this class extends ResourceRegistry. |
|---|
| | 73 | * @noextend This class is not intended to be subclassed by clients. |
|---|
| 73 | 74 | */ |
|---|
| 74 | 75 | public class FontRegistry : ResourceRegistry { |
|---|
| … | … | |
| 217 | 218 | */ |
|---|
| 218 | 219 | protected Runnable displayRunnable; |
|---|
| | 220 | |
|---|
| | 221 | private bool displayDisposeHooked; |
|---|
| | 222 | |
|---|
| | 223 | private final bool cleanOnDisplayDisposal; |
|---|
| 219 | 224 | |
|---|
| 220 | 225 | /** |
|---|
| … | … | |
| 293 | 298 | readResourceBundle(location); |
|---|
| 294 | 299 | |
|---|
| | 300 | cleanOnDisplayDisposal = true; |
|---|
| 295 | 301 | hookDisplayDispose(display); |
|---|
| 296 | 302 | } |
|---|
| … | … | |
| 411 | 417 | initInstance(); |
|---|
| 412 | 418 | Assert.isNotNull(display); |
|---|
| | 419 | this.cleanOnDispla |
|---|