Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2008 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 135-145
Link Here
|
135 |
} |
135 |
} |
136 |
|
136 |
|
137 |
private void handlePaletteToolChanged() { |
137 |
private void handlePaletteToolChanged() { |
138 |
ToolEntry entry = getPaletteViewer().getActiveTool(); |
138 |
PaletteViewer paletteViewer = getPaletteViewer(); |
139 |
if (entry != null) |
139 |
if(paletteViewer != null){ |
140 |
setActiveTool(entry.createTool()); |
140 |
ToolEntry entry = paletteViewer.getActiveTool(); |
141 |
else |
141 |
if (entry != null) |
142 |
setActiveTool(getDefaultTool()); |
142 |
setActiveTool(entry.createTool()); |
|
|
143 |
else |
144 |
setActiveTool(getDefaultTool()); |
145 |
} |
143 |
} |
146 |
} |
144 |
|
147 |
|
145 |
/** |
148 |
/** |
Lines 183-194
Link Here
|
183 |
*/ |
186 |
*/ |
184 |
public void loadDefaultTool() { |
187 |
public void loadDefaultTool() { |
185 |
setActiveTool(null); |
188 |
setActiveTool(null); |
186 |
if (paletteRoot != null) { |
189 |
PaletteViewer paletteViewer = getPaletteViewer(); |
|
|
190 |
if (paletteRoot != null && paletteViewer != null) { |
187 |
if (paletteRoot.getDefaultEntry() != null) { |
191 |
if (paletteRoot.getDefaultEntry() != null) { |
188 |
getPaletteViewer().setActiveTool(paletteRoot.getDefaultEntry()); |
192 |
paletteViewer.setActiveTool(paletteRoot.getDefaultEntry()); |
189 |
return; |
193 |
return; |
190 |
} else |
194 |
} else |
191 |
getPaletteViewer().setActiveTool(null); |
195 |
paletteViewer.setActiveTool(null); |
192 |
} |
196 |
} |
193 |
setActiveTool(getDefaultTool()); |
197 |
setActiveTool(getDefaultTool()); |
194 |
} |
198 |
} |