Lines 25-34
Link Here
|
25 |
import java.util.ArrayList; |
25 |
import java.util.ArrayList; |
26 |
import java.util.Collection; |
26 |
import java.util.Collection; |
27 |
import java.util.Collections; |
27 |
import java.util.Collections; |
|
|
28 |
import java.util.Iterator; |
28 |
import java.util.List; |
29 |
import java.util.List; |
29 |
import java.util.ResourceBundle; |
30 |
import java.util.ResourceBundle; |
30 |
import javax.swing.AbstractAction; |
31 |
import javax.swing.AbstractAction; |
31 |
import javax.swing.Action; |
32 |
import javax.swing.Action; |
|
|
33 |
import javax.swing.JSeparator; |
32 |
import javax.swing.SwingUtilities; |
34 |
import javax.swing.SwingUtilities; |
33 |
import javax.swing.event.ChangeEvent; |
35 |
import javax.swing.event.ChangeEvent; |
34 |
import javax.swing.event.ChangeListener; |
36 |
import javax.swing.event.ChangeListener; |
Lines 56-61
Link Here
|
56 |
import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; |
58 |
import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; |
57 |
import org.openide.ErrorManager; |
59 |
import org.openide.ErrorManager; |
58 |
import org.openide.filesystems.FileObject; |
60 |
import org.openide.filesystems.FileObject; |
|
|
61 |
import org.openide.filesystems.FileSystem; |
62 |
import org.openide.filesystems.Repository; |
63 |
import org.openide.loaders.DataObject; |
64 |
import org.openide.loaders.DataObjectNotFoundException; |
65 |
import org.openide.loaders.FolderLookup; |
59 |
import org.openide.nodes.FilterNode; |
66 |
import org.openide.nodes.FilterNode; |
60 |
import org.openide.util.actions.SystemAction; |
67 |
import org.openide.util.actions.SystemAction; |
61 |
import org.openide.loaders.DataFolder; |
68 |
import org.openide.loaders.DataFolder; |
Lines 265-297
Link Here
|
265 |
|
272 |
|
266 |
ResourceBundle bundle = NbBundle.getBundle( J2SEPhysicalViewProvider.class ); |
273 |
ResourceBundle bundle = NbBundle.getBundle( J2SEPhysicalViewProvider.class ); |
267 |
|
274 |
|
268 |
return new Action[] { |
275 |
List actions = new ArrayList(); |
269 |
CommonProjectActions.newFileAction(), |
276 |
|
270 |
null, |
277 |
actions.add(CommonProjectActions.newFileAction()); |
271 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_BUILD, bundle.getString( "LBL_BuildAction_Name" ), null ), // NOI18N |
278 |
actions.add(null); |
272 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_REBUILD, bundle.getString( "LBL_RebuildAction_Name" ), null ), // NOI18N |
279 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_BUILD, bundle.getString( "LBL_BuildAction_Name" ), null )); // NOI18N |
273 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_CLEAN, bundle.getString( "LBL_CleanAction_Name" ), null ), // NOI18N |
280 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_REBUILD, bundle.getString( "LBL_RebuildAction_Name" ), null )); // NOI18N |
274 |
ProjectSensitiveActions.projectCommandAction( JavaProjectConstants.COMMAND_JAVADOC, bundle.getString( "LBL_JavadocAction_Name" ), null ), // NOI18N |
281 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_CLEAN, bundle.getString( "LBL_CleanAction_Name" ), null )); // NOI18N |
275 |
null, |
282 |
actions.add(ProjectSensitiveActions.projectCommandAction( JavaProjectConstants.COMMAND_JAVADOC, bundle.getString( "LBL_JavadocAction_Name" ), null )); // NOI18N |
276 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_RUN, bundle.getString( "LBL_RunAction_Name" ), null ), // NOI18N |
283 |
actions.add(null); |
277 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_DEBUG, bundle.getString( "LBL_DebugAction_Name" ), null ), // NOI18N |
284 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_RUN, bundle.getString( "LBL_RunAction_Name" ), null )); // NOI18N |
278 |
ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_TEST, bundle.getString( "LBL_TestAction_Name" ), null ), // NOI18N |
285 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_DEBUG, bundle.getString( "LBL_DebugAction_Name" ), null )); // NOI18N |
279 |
null, |
286 |
actions.add(ProjectSensitiveActions.projectCommandAction( ActionProvider.COMMAND_TEST, bundle.getString( "LBL_TestAction_Name" ), null )); // NOI18N |
280 |
CommonProjectActions.setAsMainProjectAction(), |
287 |
actions.add(null); |
281 |
CommonProjectActions.openSubprojectsAction(), |
288 |
actions.add(CommonProjectActions.setAsMainProjectAction()); |
282 |
CommonProjectActions.closeProjectAction(), |
289 |
actions.add(CommonProjectActions.openSubprojectsAction()); |
283 |
null, |
290 |
actions.add(CommonProjectActions.closeProjectAction()); |
284 |
SystemAction.get( org.openide.actions.FindAction.class ), |
291 |
actions.add(null); |
|
|
292 |
actions.add(SystemAction.get( org.openide.actions.FindAction.class )); |
285 |
/* |
293 |
/* |
286 |
null, |
294 |
null, |
287 |
SystemAction.get( org.openide.actions.DeleteAction.class ), |
295 |
SystemAction.get( org.openide.actions.DeleteAction.class ), |
288 |
*/ |
296 |
*/ |
289 |
null, |
297 |
|
290 |
SystemAction.get( org.openide.actions.ToolsAction.class ), |
298 |
// honor 57874 contact |
291 |
null, |
299 |
|
292 |
(broken ? brokenLinksAction : null), |
300 |
try { |
293 |
CommonProjectActions.customizeProjectAction(), |
301 |
Repository repository = Repository.getDefault(); |
294 |
}; |
302 |
FileSystem sfs = repository.getDefaultFileSystem(); |
|
|
303 |
FileObject fo = sfs.findResource("Projects/Actions"); // NOI18N |
304 |
if (fo != null) { |
305 |
DataObject dobj = DataObject.find(fo); |
306 |
FolderLookup actionRegistry = new FolderLookup((DataFolder)dobj); |
307 |
Lookup.Template query = new Lookup.Template(Object.class); |
308 |
Lookup lookup = actionRegistry.getLookup(); |
309 |
Iterator it = lookup.lookup(query).allInstances().iterator(); |
310 |
if (it.hasNext()) { |
311 |
actions.add(null); |
312 |
} |
313 |
while (it.hasNext()) { |
314 |
Object next = it.next(); |
315 |
if (next instanceof Action) { |
316 |
actions.add(next); |
317 |
} else if (next instanceof JSeparator) { |
318 |
actions.add(null); |
319 |
} |
320 |
} |
321 |
} |
322 |
} catch (DataObjectNotFoundException ex) { |
323 |
// data folder for exitinf fileobject expected |
324 |
ErrorManager.getDefault().notify(ex); |
325 |
} |
326 |
|
327 |
actions.add(null); |
328 |
actions.add(SystemAction.get( org.openide.actions.ToolsAction.class )); |
329 |
actions.add(null); |
330 |
if (broken) { |
331 |
actions.add(brokenLinksAction); |
332 |
} |
333 |
actions.add(CommonProjectActions.customizeProjectAction()); |
334 |
|
335 |
return (Action[]) actions.toArray(new Action[actions.size()]); |
295 |
|
336 |
|
296 |
} |
337 |
} |
297 |
|
338 |
|