Lines 34-54
Link Here
|
34 |
import org.openide.util.RequestProcessor; |
34 |
import org.openide.util.RequestProcessor; |
35 |
import org.openide.util.Utilities; |
35 |
import org.openide.util.Utilities; |
36 |
|
36 |
|
37 |
public class NewProject extends BasicAction implements Runnable { |
37 |
public class NewProject extends BasicAction { |
38 |
|
38 |
|
39 |
private static final Icon ICON = new ImageIcon( Utilities.loadImage( "org/netbeans/modules/project/ui/resources/newProject.gif" ) ); //NOI18N |
39 |
private static final Icon ICON = new ImageIcon( Utilities.loadImage( "org/netbeans/modules/project/ui/resources/newProject.gif" ) ); //NOI18N |
40 |
private static final String NAME = NbBundle.getMessage( NewProject.class, "LBL_NewProjectAction_Name" ); // NOI18N |
40 |
private static final String NAME = NbBundle.getMessage( NewProject.class, "LBL_NewProjectAction_Name" ); // NOI18N |
41 |
|
41 |
|
42 |
private boolean isWelcome = false; |
42 |
private boolean isWelcome = false; |
43 |
|
43 |
|
44 |
private static NewProjectWizard wizard; |
|
|
45 |
|
46 |
private RequestProcessor.Task bodyTask; |
44 |
private RequestProcessor.Task bodyTask; |
47 |
|
45 |
|
48 |
public NewProject() { |
46 |
public NewProject() { |
49 |
super( NAME, ICON ); |
47 |
super( NAME, ICON ); |
50 |
putValue("iconBase","org/netbeans/modules/project/ui/resources/newProject.gif"); //NOI18N |
48 |
putValue("iconBase","org/netbeans/modules/project/ui/resources/newProject.gif"); //NOI18N |
51 |
bodyTask = new RequestProcessor( "NewProjectBody" ).create( this ); // NOI18N |
49 |
bodyTask = new RequestProcessor( "NewProjectBody" ).create( new Runnable () { // NOI18N |
|
|
50 |
public void run () { |
51 |
doPerform (); |
52 |
} |
53 |
}); |
52 |
} |
54 |
} |
53 |
|
55 |
|
54 |
public static NewProject newSample() { |
56 |
public static NewProject newSample() { |
Lines 66-82
Link Here
|
66 |
} |
68 |
} |
67 |
} |
69 |
} |
68 |
|
70 |
|
69 |
public void run() { |
71 |
private void doPerform () { |
70 |
|
|
|
71 |
if ( wizard == null ) { |
72 |
FileObject fo = Repository.getDefault().getDefaultFileSystem().findResource( "Templates/Project" ); //NOI18N |
73 |
wizard = new NewProjectWizard(fo); |
74 |
} |
75 |
else { |
76 |
//Reset the inline message |
77 |
wizard.putProperty( "WizardPanel_errorMessage", ""); //NOI18N |
78 |
} |
79 |
|
72 |
|
|
|
73 |
FileObject fo = Repository.getDefault().getDefaultFileSystem().findResource( "Templates/Project" ); //NOI18N |
74 |
NewProjectWizard wizard = new NewProjectWizard(fo); |
75 |
|
80 |
if ( isWelcome ) { |
76 |
if ( isWelcome ) { |
81 |
wizard.putProperty( "PRESELECT_CATEGORY", "Samples/Standard"); |
77 |
wizard.putProperty( "PRESELECT_CATEGORY", "Samples/Standard"); |
82 |
} |
78 |
} |