eclipse plugin: unify all file's code format
This commit is contained in:
parent
aa2e4d1805
commit
172ec4ddfa
22 changed files with 62 additions and 117 deletions
|
@ -224,8 +224,7 @@ public class Logger
|
||||||
try {
|
try {
|
||||||
writer
|
writer
|
||||||
.write( String
|
.write( String
|
||||||
.format(
|
.format( "%s | %d | %s\n", //$NON-NLS-1$
|
||||||
"%s | %d | %s\n", //$NON-NLS-1$
|
|
||||||
new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( new Date( ) ), //$NON-NLS-1$
|
new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( new Date( ) ), //$NON-NLS-1$
|
||||||
severity, message ) );
|
severity, message ) );
|
||||||
writer.flush( );
|
writer.flush( );
|
||||||
|
|
|
@ -32,15 +32,11 @@ public class RegenerateBuildFiles extends ObjectActionDelegate
|
||||||
if( element instanceof IProject ) {
|
if( element instanceof IProject ) {
|
||||||
ArrayList< ReplaceableParameter > param = new ArrayList< ReplaceableParameter >( );
|
ArrayList< ReplaceableParameter > param = new ArrayList< ReplaceableParameter >( );
|
||||||
param
|
param
|
||||||
.add( new ReplaceableParameter(
|
.add( new ReplaceableParameter( "$$project_name", ( ( ( IProject ) element ).getName( ) ) ) ); //$NON-NLS-1$
|
||||||
"$$project_name", ( ( ( IProject ) element ).getName( ) ) ) ); //$NON-NLS-1$
|
|
||||||
param
|
param
|
||||||
.add( new ReplaceableParameter(
|
.add( new ReplaceableParameter( "$$project_dir_name", ( ( IProject ) element ).getName( ) ) ); //$NON-NLS-1$
|
||||||
"$$project_dir_name", ( ( IProject ) element ).getName( ) ) ); //$NON-NLS-1$
|
ResourceUtils.createFile( ( IProject ) element, "build.xml", //$NON-NLS-1$
|
||||||
ResourceUtils.createFile( ( IProject ) element,
|
TemplateProvider.getInstance( ).getProcessedTemplate( "build_xml", param ), true ); //$NON-NLS-1$
|
||||||
"build.xml", //$NON-NLS-1$
|
|
||||||
TemplateProvider.getInstance( ).getProcessedTemplate(
|
|
||||||
"build_xml", param ), true ); //$NON-NLS-1$
|
|
||||||
try {
|
try {
|
||||||
( ( IProject ) element ).refreshLocal( IResource.DEPTH_ONE,
|
( ( IProject ) element ).refreshLocal( IResource.DEPTH_ONE,
|
||||||
new NullProgressMonitor( ) );
|
new NullProgressMonitor( ) );
|
||||||
|
|
|
@ -45,8 +45,7 @@ public class DependencyListNode implements Serializable
|
||||||
* Index
|
* Index
|
||||||
*/
|
*/
|
||||||
public static final QualifiedName PDL_INDEX = new QualifiedName(
|
public static final QualifiedName PDL_INDEX = new QualifiedName(
|
||||||
WesnothPlugin.ID_PLUGIN,
|
WesnothPlugin.ID_PLUGIN, "pdl_index" ); //$NON-NLS-1$
|
||||||
"pdl_index" ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
private DependencyListNode previous_;
|
private DependencyListNode previous_;
|
||||||
private DependencyListNode next_;
|
private DependencyListNode next_;
|
||||||
|
|
|
@ -29,8 +29,7 @@ public class ImportMapHandler extends AbstractHandler
|
||||||
{
|
{
|
||||||
IFolder selectedFolder = WorkspaceUtils.getSelectedFolder( );
|
IFolder selectedFolder = WorkspaceUtils.getSelectedFolder( );
|
||||||
if( selectedFolder == null ) {
|
if( selectedFolder == null ) {
|
||||||
Logger.getInstance( ).log(
|
Logger.getInstance( ).log( "no directory selected (importMapHandler)", //$NON-NLS-1$
|
||||||
"no directory selected (importMapHandler)", //$NON-NLS-1$
|
|
||||||
Messages.ImportMapHandler_1 );
|
Messages.ImportMapHandler_1 );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,7 @@ import org.wesnoth.Messages;
|
||||||
*/
|
*/
|
||||||
public class ActionWiper implements IStartup, IPerspectiveListener
|
public class ActionWiper implements IStartup, IPerspectiveListener
|
||||||
{
|
{
|
||||||
private static final String[] ACTIONS_2_WIPE = new String[] {
|
private static final String[] ACTIONS_2_WIPE = new String[] { "org.eclipse.search.searchActionSet", //$NON-NLS-1$
|
||||||
"org.eclipse.search.searchActionSet", //$NON-NLS-1$
|
|
||||||
"org.eclipse.debug.ui.breakpointActionSet", //$NON-NLS-1$
|
"org.eclipse.debug.ui.breakpointActionSet", //$NON-NLS-1$
|
||||||
"org.eclipse.debug.ui.debugActionSet", //$NON-NLS-1$
|
"org.eclipse.debug.ui.debugActionSet", //$NON-NLS-1$
|
||||||
"org.eclipse.debug.ui.launchActionSet", //$NON-NLS-1$
|
"org.eclipse.debug.ui.launchActionSet", //$NON-NLS-1$
|
||||||
|
|
|
@ -41,20 +41,17 @@ public class WMLPerspective implements IPerspectiveFactory
|
||||||
layout.setEditorAreaVisible( true );
|
layout.setEditorAreaVisible( true );
|
||||||
|
|
||||||
// Place navigator and outline to left of editor area.
|
// Place navigator and outline to left of editor area.
|
||||||
IFolderLayout left = layout.createFolder(
|
IFolderLayout left = layout.createFolder( "left", IPageLayout.LEFT, ( float ) 0.26, editorArea ); //$NON-NLS-1$
|
||||||
"left", IPageLayout.LEFT, ( float ) 0.26, editorArea ); //$NON-NLS-1$
|
|
||||||
left.addView( WesnothProjectsExplorer.ID_PROJECTS_EXPLORER );
|
left.addView( WesnothProjectsExplorer.ID_PROJECTS_EXPLORER );
|
||||||
|
|
||||||
IFolderLayout bottom = layout.createFolder(
|
IFolderLayout bottom = layout.createFolder( "bottom", IPageLayout.BOTTOM, 0.76f, editorArea ); //$NON-NLS-1$
|
||||||
"bottom", IPageLayout.BOTTOM, 0.76f, editorArea ); //$NON-NLS-1$
|
|
||||||
bottom.addView( IPageLayout.ID_PROBLEM_VIEW );
|
bottom.addView( IPageLayout.ID_PROBLEM_VIEW );
|
||||||
bottom.addView( IPageLayout.ID_PROGRESS_VIEW );
|
bottom.addView( IPageLayout.ID_PROGRESS_VIEW );
|
||||||
bottom.addView( IConsoleConstants.ID_CONSOLE_VIEW );
|
bottom.addView( IConsoleConstants.ID_CONSOLE_VIEW );
|
||||||
bottom.addView( AddonsView.ID_ADDONS_VIEW );
|
bottom.addView( AddonsView.ID_ADDONS_VIEW );
|
||||||
bottom.addView( "org.eclipse.pde.runtime.LogView" ); //$NON-NLS-1$
|
bottom.addView( "org.eclipse.pde.runtime.LogView" ); //$NON-NLS-1$
|
||||||
|
|
||||||
IFolderLayout right = layout.createFolder(
|
IFolderLayout right = layout.createFolder( "right", IPageLayout.RIGHT, 0.68f, editorArea ); //$NON-NLS-1$
|
||||||
"right", IPageLayout.RIGHT, 0.68f, editorArea ); //$NON-NLS-1$
|
|
||||||
right.addView( IPageLayout.ID_OUTLINE );
|
right.addView( IPageLayout.ID_OUTLINE );
|
||||||
|
|
||||||
layout.addPerspectiveShortcut( ID_WMLPERSPECTIVE );
|
layout.addPerspectiveShortcut( ID_WMLPERSPECTIVE );
|
||||||
|
|
|
@ -390,8 +390,7 @@ public class WorkbenchActionBuilder extends ActionBarAdvisor
|
||||||
coolBar.setContextMenuManager( coolbarPopupMenuManager );
|
coolBar.setContextMenuManager( coolbarPopupMenuManager );
|
||||||
IMenuService menuService = ( IMenuService ) window
|
IMenuService menuService = ( IMenuService ) window
|
||||||
.getService( IMenuService.class );
|
.getService( IMenuService.class );
|
||||||
menuService.populateContributionManager( coolbarPopupMenuManager,
|
menuService.populateContributionManager( coolbarPopupMenuManager, "popup:windowCoolbarContextMenu" ); //$NON-NLS-1$
|
||||||
"popup:windowCoolbarContextMenu" ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
coolBar.add( new GroupMarker( IIDEActionConstants.GROUP_FILE ) );
|
coolBar.add( new GroupMarker( IIDEActionConstants.GROUP_FILE ) );
|
||||||
{ // File Group
|
{ // File Group
|
||||||
|
@ -709,8 +708,7 @@ public class WorkbenchActionBuilder extends ActionBarAdvisor
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
String openText = IDEWorkbenchMessages.Workbench_openPerspective;
|
String openText = IDEWorkbenchMessages.Workbench_openPerspective;
|
||||||
MenuManager changePerspMenuMgr = new MenuManager( openText,
|
MenuManager changePerspMenuMgr = new MenuManager( openText, "openPerspective" ); //$NON-NLS-1$
|
||||||
"openPerspective" ); //$NON-NLS-1$
|
|
||||||
IContributionItem changePerspMenuItem = ContributionItemFactory.PERSPECTIVES_SHORTLIST
|
IContributionItem changePerspMenuItem = ContributionItemFactory.PERSPECTIVES_SHORTLIST
|
||||||
.create( getWindow( ) );
|
.create( getWindow( ) );
|
||||||
changePerspMenuMgr.add( changePerspMenuItem );
|
changePerspMenuMgr.add( changePerspMenuItem );
|
||||||
|
|
|
@ -296,14 +296,10 @@ public class ProjectUtils
|
||||||
.normalizePath( paths.getAddonsDir( ) ) ) ) {
|
.normalizePath( paths.getAddonsDir( ) ) ) ) {
|
||||||
|
|
||||||
ArrayList< ReplaceableParameter > param = new ArrayList< ReplaceableParameter >( );
|
ArrayList< ReplaceableParameter > param = new ArrayList< ReplaceableParameter >( );
|
||||||
param.add( new ReplaceableParameter(
|
param.add( new ReplaceableParameter( "$$project_name", handle.getName( ) ) ); //$NON-NLS-1$
|
||||||
"$$project_name", handle.getName( ) ) ); //$NON-NLS-1$
|
param.add( new ReplaceableParameter( "$$project_dir_name", handle.getName( ) ) ); //$NON-NLS-1$
|
||||||
param.add( new ReplaceableParameter(
|
ResourceUtils.createFile( handle, "build.xml", //$NON-NLS-1$
|
||||||
"$$project_dir_name", handle.getName( ) ) ); //$NON-NLS-1$
|
TemplateProvider.getInstance( ).getProcessedTemplate( "build_xml", param ), true ); //$NON-NLS-1$
|
||||||
ResourceUtils.createFile( handle,
|
|
||||||
"build.xml", //$NON-NLS-1$
|
|
||||||
TemplateProvider.getInstance( ).getProcessedTemplate(
|
|
||||||
"build_xml", param ), true ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
monitor.worked( 10 );
|
monitor.worked( 10 );
|
||||||
|
|
|
@ -108,8 +108,7 @@ public class SchemaParser
|
||||||
public void parseSchemaFile( boolean force, String schemaPath )
|
public void parseSchemaFile( boolean force, String schemaPath )
|
||||||
{
|
{
|
||||||
if( parsingDone_ && ! force ) {
|
if( parsingDone_ && ! force ) {
|
||||||
Logger.getInstance( ).log(
|
Logger.getInstance( ).log( "schema not parsed since there is already in cache." ); //$NON-NLS-1$
|
||||||
"schema not parsed since there is already in cache." ); //$NON-NLS-1$
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,8 +261,7 @@ public class TemplateProvider
|
||||||
.getInstance( )
|
.getInstance( )
|
||||||
.logError(
|
.logError(
|
||||||
String
|
String
|
||||||
.format(
|
.format( "error parsing 'structure template' (%s) on line %s", //$NON-NLS-1$
|
||||||
"error parsing 'structure template' (%s) on line %s", //$NON-NLS-1$
|
|
||||||
structureTemplate, line ) );
|
structureTemplate, line ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,8 +344,7 @@ public class ResourceUtils
|
||||||
File antFile = new File( path );
|
File antFile = new File( path );
|
||||||
createNewFile( antFile.getAbsolutePath( ) );
|
createNewFile( antFile.getAbsolutePath( ) );
|
||||||
FileWriter writer = new FileWriter( antFile );
|
FileWriter writer = new FileWriter( antFile );
|
||||||
writer.write( TemplateProvider.getInstance( ).getProcessedTemplate(
|
writer.write( TemplateProvider.getInstance( ).getProcessedTemplate( "build_xml", params ) ); //$NON-NLS-1$
|
||||||
"build_xml", params ) ); //$NON-NLS-1$
|
|
||||||
writer.close( );
|
writer.close( );
|
||||||
} catch( Exception e ) {
|
} catch( Exception e ) {
|
||||||
Logger.getInstance( ).logException( e );
|
Logger.getInstance( ).logException( e );
|
||||||
|
@ -596,8 +595,7 @@ public class ResourceUtils
|
||||||
int lineNumber = Integer.parseInt( line.substring( pivotIndex
|
int lineNumber = Integer.parseInt( line.substring( pivotIndex
|
||||||
+ pivot.length( ),
|
+ pivot.length( ),
|
||||||
line.indexOf( ":", pivotIndex + pivot.length( ) + 1 ) ) ); //$NON-NLS-1$
|
line.indexOf( ":", pivotIndex + pivot.length( ) + 1 ) ) ); //$NON-NLS-1$
|
||||||
String message = line.substring( line.indexOf(
|
String message = line.substring( line.indexOf( " ", pivotIndex + pivot.length( ) + 1 ) ); //$NON-NLS-1$
|
||||||
" ", pivotIndex + pivot.length( ) + 1 ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
// Get the file
|
// Get the file
|
||||||
IFile file = ResourcesPlugin.getWorkspace( ).getRoot( )
|
IFile file = ResourcesPlugin.getWorkspace( ).getRoot( )
|
||||||
|
|
|
@ -351,8 +351,7 @@ public class WorkspaceUtils
|
||||||
|
|
||||||
if( ! checkPathsAreSet( Preferences.getDefaultInstallName( ), false ) ) {
|
if( ! checkPathsAreSet( Preferences.getDefaultInstallName( ), false ) ) {
|
||||||
PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
|
PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
|
||||||
WesnothPlugin.getShell( ),
|
WesnothPlugin.getShell( ), "org.wesnoth.preferences.InstallsPage", null, null ); //$NON-NLS-1$
|
||||||
"org.wesnoth.preferences.InstallsPage", null, null ); //$NON-NLS-1$
|
|
||||||
pref.open( );
|
pref.open( );
|
||||||
if( ! checkPathsAreSet( Preferences.getDefaultInstallName( ), true ) ) {
|
if( ! checkPathsAreSet( Preferences.getDefaultInstallName( ), true ) ) {
|
||||||
GUIUtils.showErrorMessageBox( Messages.WorkspaceUtils_7 );
|
GUIUtils.showErrorMessageBox( Messages.WorkspaceUtils_7 );
|
||||||
|
@ -411,8 +410,7 @@ public class WorkspaceUtils
|
||||||
.showInfoMessageBox( Messages.WorkspaceUtils_25 );
|
.showInfoMessageBox( Messages.WorkspaceUtils_25 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.getInstance( ).log(
|
Logger.getInstance( ).log( "setupWorkspace was successful", //$NON-NLS-1$
|
||||||
"setupWorkspace was successful", //$NON-NLS-1$
|
|
||||||
Messages.WorkspaceUtils_29 );
|
Messages.WorkspaceUtils_29 );
|
||||||
}
|
}
|
||||||
} catch( Exception e ) {
|
} catch( Exception e ) {
|
||||||
|
|
|
@ -70,8 +70,7 @@ public class CampaignNewWizard extends WizardTemplate
|
||||||
page1_.needsPBLFile( ) );
|
page1_.needsPBLFile( ) );
|
||||||
|
|
||||||
// store some campaign-related info
|
// store some campaign-related info
|
||||||
ProjectUtils.getPropertiesForProject( currentProject ).put(
|
ProjectUtils.getPropertiesForProject( currentProject ).put( "difficulties", page2_.getDifficulties( ) ); //$NON-NLS-1$
|
||||||
"difficulties", page2_.getDifficulties( ) ); //$NON-NLS-1$
|
|
||||||
ProjectUtils.getCacheForProject( currentProject )
|
ProjectUtils.getCacheForProject( currentProject )
|
||||||
.saveCache( );
|
.saveCache( );
|
||||||
|
|
||||||
|
@ -89,38 +88,28 @@ public class CampaignNewWizard extends WizardTemplate
|
||||||
{
|
{
|
||||||
List< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
List< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$campaign_name", page1_.getCampaignName( ) ) ); //$NON-NLS-1$
|
||||||
"$$campaign_name", page1_.getCampaignName( ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$author", page1_.getAuthor( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$author", page1_.getAuthor( ) ) ); //$NON-NLS-1$
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$version", page1_.getVersion( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$version", page1_.getVersion( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$description", page1_.getCampaignDescription( ) ) ); //$NON-NLS-1$
|
||||||
"$$description", page1_.getCampaignDescription( ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$icon", page1_.getIconPath( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$icon", page1_.getIconPath( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter( "$$email", page1_.getEmail( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$email", page1_.getEmail( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$passphrase", page1_.getPassphrase( ) ) ); //$NON-NLS-1$
|
||||||
"$$passphrase", page1_.getPassphrase( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$translations_dir", page1_.getTranslationDir( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$translations_dir", page1_.getTranslationDir( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$campaign_id", page2_.getCampaignId( ) ) ); //$NON-NLS-1$
|
||||||
"$$campaign_id", page2_.getCampaignId( ) ) ); //$NON-NLS-1$
|
|
||||||
params.add( new ReplaceableParameter( "$$abrev", page2_.getAbbrev( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$abrev", page2_.getAbbrev( ) ) ); //$NON-NLS-1$
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$define", page2_.getDefine( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$define", page2_.getDefine( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$difficulties", page2_.getDifficulties( ) ) ); //$NON-NLS-1$
|
||||||
"$$difficulties", page2_.getDifficulties( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$first_scenario", page2_.getFirstScenario( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$first_scenario", page2_.getFirstScenario( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$project_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
||||||
"$$project_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$project_dir_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$type", page1_.isMultiplayer( ) ? "campaign_mp": "campaign" ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
"$$project_dir_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$type", page1_.isMultiplayer( ) ? "campaign_mp": "campaign" ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,26 +81,20 @@ public class EmptyProjectNewWizard extends WizardTemplate
|
||||||
{
|
{
|
||||||
List< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
List< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$campaign_name", page1_.getCampaignName( ) ) ); //$NON-NLS-1$
|
||||||
"$$campaign_name", page1_.getCampaignName( ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$author", page1_.getAuthor( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$author", page1_.getAuthor( ) ) ); //$NON-NLS-1$
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$version", page1_.getVersion( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$version", page1_.getVersion( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$description", page1_.getPBLDescription( ) ) ); //$NON-NLS-1$
|
||||||
"$$description", page1_.getPBLDescription( ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$icon", page1_.getIconPath( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$icon", page1_.getIconPath( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter( "$$email", page1_.getEmail( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$email", page1_.getEmail( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$passphrase", page1_.getPassphrase( ) ) ); //$NON-NLS-1$
|
||||||
"$$passphrase", page1_.getPassphrase( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$translations_dir", page1_.getTranslationDir( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$translations_dir", page1_.getTranslationDir( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$project_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
||||||
"$$project_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$project_dir_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$project_dir_name", page0_.getProjectName( ) ) ); //$NON-NLS-1$
|
|
||||||
params.add( new ReplaceableParameter( "$$type", page1_.getType( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$type", page1_.getType( ) ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
|
|
|
@ -142,11 +142,9 @@ public class EraNewWizard extends WizardTemplate
|
||||||
params.add( new ReplaceableParameter( "$$era_id", page0_.getEraID( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$era_id", page0_.getEraID( ) ) ); //$NON-NLS-1$
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$era_name", page0_.getEraName( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$era_name", page0_.getEraName( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$require_era", String.valueOf( page0_.getRequiresEra( ) ) ) ); //$NON-NLS-1$
|
||||||
"$$require_era", String.valueOf( page0_.getRequiresEra( ) ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
String template = TemplateProvider.getInstance( ).getProcessedTemplate(
|
String template = TemplateProvider.getInstance( ).getProcessedTemplate( "era", params ); //$NON-NLS-1$
|
||||||
"era", params ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
if( template == null ) {
|
if( template == null ) {
|
||||||
Logger.getInstance( ).log( "'era' template not found", //$NON-NLS-1$
|
Logger.getInstance( ).log( "'era' template not found", //$NON-NLS-1$
|
||||||
|
|
|
@ -151,29 +151,22 @@ public class FactionNewWizard extends WizardTemplate
|
||||||
{
|
{
|
||||||
ArrayList< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
ArrayList< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
||||||
|
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$faction_id", page0_.getFactionId( ) ) ); //$NON-NLS-1$
|
||||||
"$$faction_id", page0_.getFactionId( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$faction_name", page0_.getFactionName( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$faction_type", page0_.getType( ) ) ); //$NON-NLS-1$
|
||||||
"$$faction_name", page0_.getFactionName( ) ) ); //$NON-NLS-1$
|
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$faction_type", page0_.getType( ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$leader", page0_.getLeader( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$leader", page0_.getLeader( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$random_leader", page0_.getRandomLeader( ) ) ); //$NON-NLS-1$
|
||||||
"$$random_leader", page0_.getRandomLeader( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$terrain_liked", page0_.getTerrainLiked( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$terrain_liked", page0_.getTerrainLiked( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter(
|
.add( new ReplaceableParameter( "$$random_faction", String.valueOf( page1_.getIsRandomFaction( ) ) ) ); //$NON-NLS-1$
|
||||||
"$$random_faction", String.valueOf( page1_.getIsRandomFaction( ) ) ) ); //$NON-NLS-1$
|
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$choices", page1_.getChoices( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$choices", page1_.getChoices( ) ) ); //$NON-NLS-1$
|
||||||
params
|
params
|
||||||
.add( new ReplaceableParameter( "$$except", page1_.getExcept( ) ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$except", page1_.getExcept( ) ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
String template = TemplateProvider.getInstance( ).getProcessedTemplate(
|
String template = TemplateProvider.getInstance( ).getProcessedTemplate( "faction", params ); //$NON-NLS-1$
|
||||||
"faction", params ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
if( template == null ) {
|
if( template == null ) {
|
||||||
Logger.getInstance( ).log( "'faction' template not found", //$NON-NLS-1$
|
Logger.getInstance( ).log( "'faction' template not found", //$NON-NLS-1$
|
||||||
|
|
|
@ -122,8 +122,7 @@ public class WizardGeneratorKeysPage extends WizardPageTemplate
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( txt.getText( ).isEmpty( ) && ( txt.getData(
|
if( ( txt.getText( ).isEmpty( ) && ( txt.getData( "card" ).toString( ).equals( "1" ) ) ) || // cardinality //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
"card" ).toString( ).equals( "1" ) ) ) || // cardinality //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
! txt.getText( ).matches(
|
! txt.getText( ).matches(
|
||||||
txt.getData( "valType" ).toString( ) ) // regex //$NON-NLS-1$
|
txt.getData( "valType" ).toString( ) ) // regex //$NON-NLS-1$
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -193,12 +193,9 @@ public class ScenarioNewWizard extends WizardTemplate
|
||||||
ArrayList< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
ArrayList< ReplaceableParameter > params = new ArrayList< ReplaceableParameter >( );
|
||||||
|
|
||||||
// common variables (sp + mp)
|
// common variables (sp + mp)
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$scenario_id", page0_.getScenarioId( ) ) ); //$NON-NLS-1$
|
||||||
"$$scenario_id", page0_.getScenarioId( ) ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$next_scenario_id", page0_.getNextScenarioId( ) ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$scenario_name", page0_.getScenarioName( ) ) ); //$NON-NLS-1$
|
||||||
"$$next_scenario_id", page0_.getNextScenarioId( ) ) ); //$NON-NLS-1$
|
|
||||||
params.add( new ReplaceableParameter(
|
|
||||||
"$$scenario_name", page0_.getScenarioName( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
String mapData = ""; //$NON-NLS-1$
|
String mapData = ""; //$NON-NLS-1$
|
||||||
if( ! page0_.getMapData( ).isEmpty( ) ) {
|
if( ! page0_.getMapData( ).isEmpty( ) ) {
|
||||||
|
@ -218,8 +215,7 @@ public class ScenarioNewWizard extends WizardTemplate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.add( new ReplaceableParameter( "$$map_data", mapData ) ); //$NON-NLS-1$
|
params.add( new ReplaceableParameter( "$$map_data", mapData ) ); //$NON-NLS-1$
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$turns_number", String.valueOf( page0_.getTurnsNumber( ) ) ) ); //$NON-NLS-1$
|
||||||
"$$turns_number", String.valueOf( page0_.getTurnsNumber( ) ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
String startingGold = ""; //$NON-NLS-1$
|
String startingGold = ""; //$NON-NLS-1$
|
||||||
if( page1_ != null ) {
|
if( page1_ != null ) {
|
||||||
|
@ -232,8 +228,7 @@ public class ScenarioNewWizard extends WizardTemplate
|
||||||
.add( new ReplaceableParameter( "$$starting_gold", startingGold ) ); //$NON-NLS-1$
|
.add( new ReplaceableParameter( "$$starting_gold", startingGold ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
// multiplayer only variables
|
// multiplayer only variables
|
||||||
params.add( new ReplaceableParameter(
|
params.add( new ReplaceableParameter( "$$allow_new_game", page2_.getAllowNewGame( ) ) ); //$NON-NLS-1$
|
||||||
"$$allow_new_game", page2_.getAllowNewGame( ) ) ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
String template = TemplateProvider
|
String template = TemplateProvider
|
||||||
.getInstance( )
|
.getInstance( )
|
||||||
|
|
Loading…
Add table
Reference in a new issue