|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2004 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 15-20
Link Here
|
| 15 |
|
15 |
|
| 16 |
import org.eclipse.core.runtime.NullProgressMonitor; |
16 |
import org.eclipse.core.runtime.NullProgressMonitor; |
| 17 |
import org.eclipse.jface.action.CoolBarManager; |
17 |
import org.eclipse.jface.action.CoolBarManager; |
|
|
18 |
import org.eclipse.jface.action.ICoolBarManager; |
| 19 |
import org.eclipse.jface.action.IToolBarManager2; |
| 18 |
import org.eclipse.jface.action.MenuManager; |
20 |
import org.eclipse.jface.action.MenuManager; |
| 19 |
import org.eclipse.jface.action.StatusLineManager; |
21 |
import org.eclipse.jface.action.StatusLineManager; |
| 20 |
import org.eclipse.jface.action.ToolBarManager; |
22 |
import org.eclipse.jface.action.ToolBarManager; |
|
Lines 77-83
Link Here
|
| 77 |
* |
79 |
* |
| 78 |
* @see #addToolBar |
80 |
* @see #addToolBar |
| 79 |
*/ |
81 |
*/ |
| 80 |
private ToolBarManager toolBarManager = null; |
82 |
protected IToolBarManager2 toolBarManager = null; |
| 81 |
|
83 |
|
| 82 |
/** |
84 |
/** |
| 83 |
* Status line manager, or <code>null</code> if none (default). |
85 |
* Status line manager, or <code>null</code> if none (default). |
|
Lines 92-98
Link Here
|
| 92 |
* @see #addCoolBar |
94 |
* @see #addCoolBar |
| 93 |
* @since 3.0 |
95 |
* @since 3.0 |
| 94 |
*/ |
96 |
*/ |
| 95 |
private CoolBarManager coolBarManager = null; |
97 |
protected ICoolBarManager coolBarManager = null; |
| 96 |
|
98 |
|
| 97 |
/** |
99 |
/** |
| 98 |
* The seperator between the menu bar and the rest of the window. |
100 |
* The seperator between the menu bar and the rest of the window. |
|
Lines 255-261
Link Here
|
| 255 |
protected void addToolBar(int style) { |
257 |
protected void addToolBar(int style) { |
| 256 |
if ((getShell() == null) && (toolBarManager == null) |
258 |
if ((getShell() == null) && (toolBarManager == null) |
| 257 |
&& (coolBarManager == null)) { |
259 |
&& (coolBarManager == null)) { |
| 258 |
toolBarManager = createToolBarManager(style); |
260 |
toolBarManager = createToolBarManager2(style); |
| 259 |
} |
261 |
} |
| 260 |
} |
262 |
} |
| 261 |
|
263 |
|
|
Lines 270-277
Link Here
|
| 270 |
protected void addCoolBar(int style) { |
272 |
protected void addCoolBar(int style) { |
| 271 |
if ((getShell() == null) && (toolBarManager == null) |
273 |
if ((getShell() == null) && (toolBarManager == null) |
| 272 |
&& (coolBarManager == null)) { |
274 |
&& (coolBarManager == null)) { |
| 273 |
coolBarManager = createCoolBarManager(style); |
275 |
coolBarManager = createCoolBarManager2(style); |
| 274 |
} |
276 |
} |
| 275 |
} |
277 |
} |
| 276 |
|
278 |
|
| 277 |
/* (non-Javadoc) |
279 |
/* (non-Javadoc) |
|
Lines 404-409
Link Here
|
| 404 |
protected ToolBarManager createToolBarManager(int style) { |
406 |
protected ToolBarManager createToolBarManager(int style) { |
| 405 |
return new ToolBarManager(style); |
407 |
return new ToolBarManager(style); |
| 406 |
} |
408 |
} |
|
|
409 |
|
| 410 |
/** |
| 411 |
* Returns a new tool bar manager for the window. |
| 412 |
* <p> |
| 413 |
* By default this method calls <code>createToolBarManager</code>. Subclasses |
| 414 |
* may override this method to provide an alternative implementation for the |
| 415 |
* tool bar manager. |
| 416 |
* </p> |
| 417 |
* @return a tool bar manager |
| 418 |
* @since 3.2 |
| 419 |
*/ |
| 420 |
protected IToolBarManager2 createToolBarManager2(int style) { |
| 421 |
return createToolBarManager(style); |
| 422 |
} |
| 407 |
|
423 |
|
| 408 |
/** |
424 |
/** |
| 409 |
* Returns a new cool bar manager for the window. |
425 |
* Returns a new cool bar manager for the window. |
|
Lines 417-422
Link Here
|
| 417 |
protected CoolBarManager createCoolBarManager(int style) { |
433 |
protected CoolBarManager createCoolBarManager(int style) { |
| 418 |
return new CoolBarManager(style); |
434 |
return new CoolBarManager(style); |
| 419 |
} |
435 |
} |
|
|
436 |
|
| 437 |
/** |
| 438 |
* Returns a new cool bar manager for the window. |
| 439 |
* <p> |
| 440 |
* By default this method calls <code>createCoolBarManager</code>. Subclasses |
| 441 |
* may override this method to provide an alternative implementation for the |
| 442 |
* cool bar manager. |
| 443 |
* </p> |
| 444 |
* |
| 445 |
* @return a cool bar manager |
| 446 |
* @since 3.2 |
| 447 |
*/ |
| 448 |
protected ICoolBarManager createCoolBarManager2(int style) { |
| 449 |
return createCoolBarManager(style); |
| 450 |
} |
| 420 |
|
451 |
|
| 421 |
/** |
452 |
/** |
| 422 |
* Creates the control for the tool bar manager. |
453 |
* Creates the control for the tool bar manager. |
|
Lines 427-433
Link Here
|
| 427 |
*/ |
458 |
*/ |
| 428 |
protected Control createToolBarControl(Composite parent) { |
459 |
protected Control createToolBarControl(Composite parent) { |
| 429 |
if (toolBarManager != null) { |
460 |
if (toolBarManager != null) { |
| 430 |
return toolBarManager.createControl(parent); |
461 |
return toolBarManager.createControl2(parent); |
| 431 |
} |
462 |
} |
| 432 |
return null; |
463 |
return null; |
| 433 |
} |
464 |
} |
|
Lines 443-449
Link Here
|
| 443 |
*/ |
474 |
*/ |
| 444 |
protected Control createCoolBarControl(Composite composite) { |
475 |
protected Control createCoolBarControl(Composite composite) { |
| 445 |
if (coolBarManager != null) { |
476 |
if (coolBarManager != null) { |
| 446 |
return coolBarManager.createControl(composite); |
477 |
return coolBarManager.createControl2(composite); |
| 447 |
} |
478 |
} |
| 448 |
return null; |
479 |
return null; |
| 449 |
} |
480 |
} |
|
Lines 510-515
Link Here
|
| 510 |
* @see #addToolBar(int) |
541 |
* @see #addToolBar(int) |
| 511 |
*/ |
542 |
*/ |
| 512 |
public ToolBarManager getToolBarManager() { |
543 |
public ToolBarManager getToolBarManager() { |
|
|
544 |
if (toolBarManager instanceof ToolBarManager) |
| 545 |
return (ToolBarManager)toolBarManager; |
| 546 |
return null; |
| 547 |
} |
| 548 |
|
| 549 |
/** |
| 550 |
* Returns the tool bar manager for this window (if it has one). |
| 551 |
* |
| 552 |
* @return the tool bar manager, or <code>null</code> if |
| 553 |
* this window does not have a tool bar |
| 554 |
* @see #addToolBar(int) |
| 555 |
* @since 3.2 |
| 556 |
*/ |
| 557 |
public IToolBarManager2 getToolBarManager2() { |
| 513 |
return toolBarManager; |
558 |
return toolBarManager; |
| 514 |
} |
559 |
} |
| 515 |
|
560 |
|
|
Lines 522-527
Link Here
|
| 522 |
* @since 3.0 |
567 |
* @since 3.0 |
| 523 |
*/ |
568 |
*/ |
| 524 |
public CoolBarManager getCoolBarManager() { |
569 |
public CoolBarManager getCoolBarManager() { |
|
|
570 |
if (coolBarManager instanceof CoolBarManager) |
| 571 |
return (CoolBarManager)coolBarManager; |
| 572 |
return null; |
| 573 |
} |
| 574 |
|
| 575 |
/** |
| 576 |
* Returns the cool bar manager for this window. |
| 577 |
* |
| 578 |
* @return the cool bar manager, or <code>null</code> if |
| 579 |
* this window does not have a cool bar |
| 580 |
* @see #addCoolBar(int) |
| 581 |
* @since 3.2 |
| 582 |
*/ |
| 583 |
public ICoolBarManager getCoolBarManager2() { |
| 525 |
return coolBarManager; |
584 |
return coolBarManager; |
| 526 |
} |
585 |
} |
| 527 |
|
586 |
|