Refactors preferences naming to language+hardware+editor

This commit is contained in:
Peter Dell 2023-01-08 01:35:24 +01:00
parent e102c2b22d
commit ee7d657e3a
44 changed files with 2349 additions and 2175 deletions

View File

@ -20,7 +20,7 @@ package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding arbitrary * Visual editor page for the assembler preferences regarding arbitrary
@ -29,7 +29,7 @@ import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesTestCompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerPreferencesTestCompilersPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".

View File

@ -1,12 +1,12 @@
com.wudsn.ide.lng.asm.preferences.AssemblerPreferences.name=Assembler Preferences com.wudsn.ide.lng.asm.preferences.AssemblerPreferences.name=Assembler Preferences
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name=Assembler com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name=Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage.name=Apple II Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name=Apple II Assemblers
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name=Atari 2600 Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name=Atari 2600 Assemblers
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name=Atari 7800 Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name=Atari 7800 Assemblers
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name=Atari 8-bit Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name=Atari 8-bit Assemblers
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name=C64 Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage.name=C64 Assemblers
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name=NES Assemblers com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage.name=NES Assemblers
com.wudsn.ide.lng.asm.compiler.acme.AcmeCompiler.name=ACME com.wudsn.ide.lng.asm.compiler.acme.AcmeCompiler.name=ACME
com.wudsn.ide.lng.asm.compiler.acme.AcmeEditor.name=ACME Editor com.wudsn.ide.lng.asm.compiler.acme.AcmeEditor.name=ACME Editor

View File

@ -1,12 +1,12 @@
com.wudsn.ide.lng.asm.preferences.AssemblerPreferences.name=Assembler Einstellungen com.wudsn.ide.lng.asm.preferences.AssemblerPreferences.name=Assembler Einstellungen
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name=Assembler com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name=Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage.name=Apple II Assembler com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name=Apple II Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name=Atari 2600 Assembler com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name=Atari 2600 Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name=Atari 7800 Assembler com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name=Atari 7800 Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name=Atari 8-bit Assembler com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name=Atari 8-bit Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name=C64 Assembler com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage.name=C64 Assembler
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name=NES Assembler com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage.name=NES Assembler
com.wudsn.ide.lng.asm.compiler.acme.AcmeCompiler.name=ACME com.wudsn.ide.lng.asm.compiler.acme.AcmeCompiler.name=ACME
com.wudsn.ide.lng.asm.compiler.acme.AcmeEditor.name=ACME Editor com.wudsn.ide.lng.asm.compiler.acme.AcmeEditor.name=ACME Editor

View File

@ -15,39 +15,39 @@
point="org.eclipse.ui.preferencePages"> point="org.eclipse.ui.preferencePages">
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtar7800CompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage" category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage" class="com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage"
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage" id="com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage"
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name"> name="%com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage.name">
</page> </page>
</extension> </extension>
<extension point="com.wudsn.ide.lng.compilers"> <extension point="com.wudsn.ide.lng.compilers">

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding Apple 2 compilers. * Visual editor page for the assembler preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesApple2CompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerApple2PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesApple2CompilersPage() { public AssemblerApple2PreferencesPage() {
super(Language.ASM, Hardware.APPLE2); super(Language.ASM, Hardware.APPLE2);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding Apple 2 compilers. * Visual editor page for the assembler preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesAtari2600CompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerAtari2600PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesAtari2600CompilersPage() { public AssemblerAtari2600PreferencesPage() {
super(Language.ASM,Hardware.ATARI2600); super(Language.ASM,Hardware.ATARI2600);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding Apple 2 compilers. * Visual editor page for the assembler preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesAtari7800CompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerAtari7800PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesAtari7800CompilersPage() { public AssemblerAtari7800PreferencesPage() {
super(Language.ASM, Hardware.ATARI7800); super(Language.ASM, Hardware.ATARI7800);
} }
} }

View File

@ -1,42 +1,42 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding Atari 8-bit * Visual editor page for the assembler preferences regarding Atari 8-bit
* compilers. * compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesAtari8CompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerAtari8PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesAtari8CompilersPage() { public AssemblerAtari8PreferencesPage() {
super(Language.ASM,Hardware.ATARI8BIT); super(Language.ASM,Hardware.ATARI8BIT);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding C64 compilers. * Visual editor page for the assembler preferences regarding C64 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesC64CompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerC64PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesC64CompilersPage() { public AssemblerC64PreferencesPage() {
super(Language.ASM, Hardware.C64); super(Language.ASM, Hardware.C64);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.asm.preferences; package com.wudsn.ide.lng.asm.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the assembler preferences regarding NES compilers. * Visual editor page for the assembler preferences regarding NES compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class AssemblerPreferencesNESCompilersPage extends LanguagePreferencesCompilersPage { public final class AssemblerNESPreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public AssemblerPreferencesNESCompilersPage() { public AssemblerNESPreferencesPage() {
super(Language.ASM, Hardware.NES); super(Language.ASM, Hardware.NES);
} }
} }

View File

@ -1,12 +1,12 @@
com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Pascal Preferences com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Pascal Preferences
com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal
com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage.name=Apple II Compilers com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Apple II Compilers
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Atari 2600 Compilers com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Atari 2600 Compilers
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Atari 7800 Compilers com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Atari 7800 Compilers
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Atari 8-bit Compilers com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Atari 8-bit Compilers
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=C64 Compilers com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=C64 Compilers
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=NES Compilers com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=NES Compilers
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Source File com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Source File

View File

@ -1,12 +1,12 @@
com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Ustawienia Pascala com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Ustawienia Pascala
com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal
com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage.name=Kompilator Apple II com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Kompilator Apple II
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Kompilator Atari 2600 com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Kompilator Atari 2600
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Kompilator Atari 7800 com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Kompilator Atari 7800
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Kompilator Atari 8-bit com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Kompilator Atari 8-bit
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=Kompilator C64 com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=Kompilator C64
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=Kompilator NES com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=Kompilator NES
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Plik \u017Aród\u0142owy Pascala com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Plik \u017Aród\u0142owy Pascala

View File

@ -1,12 +1,12 @@
com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Pascal Einstellungen com.wudsn.ide.lng.pas.preferences.PascalPreferences.name=Pascal Einstellungen
com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage.name=Pascal
com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage.name=Apple II Kompiler com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Apple II Kompiler
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Atari 2600 Kompiler com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Atari 2600 Kompiler
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Atari 7800 Kompiler com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Atari 7800 Kompiler
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Atari 8-bit Kompiler com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Atari 8-bit Kompiler
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=C64 Kompiler com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=C64 Kompiler
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=NES Kompiler com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=NES Kompiler
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Quell-Datei com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Quell-Datei

View File

@ -14,39 +14,39 @@
point="org.eclipse.ui.preferencePages"> point="org.eclipse.ui.preferencePages">
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtar7800CompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPag"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name">
</page> </page>
<page <page
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage" category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage" class="com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage"
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage" id="com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage"
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name"> name="%com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name">
</page> </page>
</extension> </extension>

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding Apple 2 compilers. * Visual editor page for the Pascal preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesApple2CompilersPage extends LanguagePreferencesCompilersPage { public final class PascalApple2PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesApple2CompilersPage() { public PascalApple2PreferencesPage() {
super(Language.PAS, Hardware.APPLE2); super(Language.PAS, Hardware.APPLE2);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding Apple 2 compilers. * Visual editor page for the Pascal preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesAtari2600CompilersPage extends LanguagePreferencesCompilersPage { public final class PascalAtari2600PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesAtari2600CompilersPage() { public PascalAtari2600PreferencesPage() {
super(Language.PAS,Hardware.ATARI2600); super(Language.PAS,Hardware.ATARI2600);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding Apple 2 compilers. * Visual editor page for the Pascal preferences regarding Apple 2 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesAtari7800CompilersPage extends LanguagePreferencesCompilersPage { public final class PascalAtari7800PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesAtari7800CompilersPage() { public PascalAtari7800PreferencesPage() {
super(Language.PAS, Hardware.ATARI7800); super(Language.PAS, Hardware.ATARI7800);
} }
} }

View File

@ -1,42 +1,42 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding Atari 8-bit * Visual editor page for the Pascal preferences regarding Atari 8-bit
* compilers. * compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesAtari8CompilersPage extends LanguagePreferencesCompilersPage { public final class PascalAtari8PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesAtari8CompilersPage() { public PascalAtari8PreferencesPage() {
super(Language.PAS,Hardware.ATARI8BIT); super(Language.PAS,Hardware.ATARI8BIT);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding C64 compilers. * Visual editor page for the Pascal preferences regarding C64 compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesC64CompilersPage extends LanguagePreferencesCompilersPage { public final class PascalC64PreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesC64CompilersPage() { public PascalC64PreferencesPage() {
super(Language.PAS, Hardware.C64); super(Language.PAS, Hardware.C64);
} }
} }

View File

@ -1,41 +1,41 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.pas.preferences; package com.wudsn.ide.lng.pas.preferences;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage; import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
/** /**
* Visual editor page for the Pascal preferences regarding NES compilers. * Visual editor page for the Pascal preferences regarding NES compilers.
* *
* @author Peter Dell * @author Peter Dell
* *
*/ */
public final class PascalPreferencesNESCompilersPage extends LanguagePreferencesCompilersPage { public final class PascalNESPreferencesPage extends LanguageHardwarePreferencesPage {
/** /**
* Create is public. Used by extension point "org.eclipse.ui.preferencePages". * Create is public. Used by extension point "org.eclipse.ui.preferencePages".
*/ */
public PascalPreferencesNESCompilersPage() { public PascalNESPreferencesPage() {
super(Language.PAS,Hardware.NES); super(Language.PAS,Hardware.NES);
} }
} }

View File

@ -48,13 +48,12 @@ import com.wudsn.ide.lng.compiler.CompilerPathsTest;
import com.wudsn.ide.lng.compiler.CompilerRegistry; import com.wudsn.ide.lng.compiler.CompilerRegistry;
import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.LanguagePreferences;
import com.wudsn.ide.lng.preferences.LanguagePreferencesChangeListener; import com.wudsn.ide.lng.preferences.LanguagePreferencesChangeListener;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants;
import com.wudsn.ide.lng.preferences.LanguagesPreferences; import com.wudsn.ide.lng.preferences.LanguagesPreferences;
import com.wudsn.ide.lng.preferences.TextAttributeDefinition; import com.wudsn.ide.lng.preferences.TextAttributeDefinition;
import com.wudsn.ide.lng.runner.RunnerPaths; import com.wudsn.ide.lng.runner.RunnerPaths;
import com.wudsn.ide.lng.runner.RunnerPathsTest; import com.wudsn.ide.lng.runner.RunnerPathsTest;
import com.wudsn.ide.lng.runner.RunnerRegistry; import com.wudsn.ide.lng.runner.RunnerRegistry;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
/** /**
* The main plugin class to be used in the desktop. * The main plugin class to be used in the desktop.
* *
@ -150,6 +149,7 @@ public final class LanguagePlugin extends AbstractIDEPlugin {
logError("Cannot initialize compiler registry", null, ex); logError("Cannot initialize compiler registry", null, ex);
throw ex; throw ex;
} }
compilerPaths.init();
compilerConsole = new CompilerConsole(); compilerConsole = new CompilerConsole();
try { try {
runnerRegistry.init(); runnerRegistry.init();
@ -167,7 +167,7 @@ public final class LanguagePlugin extends AbstractIDEPlugin {
if (event.getProperty().equals(JFaceResources.TEXT_FONT) if (event.getProperty().equals(JFaceResources.TEXT_FONT)
|| event.getProperty().equals(BLOCK_SELECTION_MODE_FONT)) { || event.getProperty().equals(BLOCK_SELECTION_MODE_FONT)) {
for (Language language : languages) { for (Language language : languages) {
List<TextAttributeDefinition> textAttributeDefinitions = LanguagePreferencesConstants List<TextAttributeDefinition> textAttributeDefinitions = EditorConstants
.getTextAttributeDefinitions(language); .getTextAttributeDefinitions(language);
Set<String> changedPropertyNames = new TreeSet<String>(); Set<String> changedPropertyNames = new TreeSet<String>();
for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) { for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) {

View File

@ -27,7 +27,7 @@ import com.wudsn.ide.base.common.FileUtility;
import com.wudsn.ide.base.common.StringUtility; import com.wudsn.ide.base.common.StringUtility;
import com.wudsn.ide.lng.LanguageProperties; import com.wudsn.ide.lng.LanguageProperties;
import com.wudsn.ide.lng.LanguageProperties.LanguageProperty; import com.wudsn.ide.lng.LanguageProperties.LanguageProperty;
import com.wudsn.ide.lng.preferences.CompilerPreferences; import com.wudsn.ide.lng.preferences.LanguageHardwareCompilerDefinitionPreferences;
/** /**
* Container class for the folder, file names and paths of the source file, the * Container class for the folder, file names and paths of the source file, the
@ -116,7 +116,7 @@ public final class CompilerFiles {
public CompilerFiles(IFile mainSourceIFile, LanguageProperties mainSourceFileLanguageProperties, public CompilerFiles(IFile mainSourceIFile, LanguageProperties mainSourceFileLanguageProperties,
IFile sourceIFile, LanguageProperties sourceFileLanguageProperties, IFile sourceIFile, LanguageProperties sourceFileLanguageProperties,
CompilerPreferences compilerPreferences) { LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences) {
if (mainSourceIFile == null) { if (mainSourceIFile == null) {
throw new IllegalArgumentException("Parameter 'mainSourceIFile' must not be null."); throw new IllegalArgumentException("Parameter 'mainSourceIFile' must not be null.");
@ -124,7 +124,7 @@ public final class CompilerFiles {
if (sourceIFile == null) { if (sourceIFile == null) {
throw new IllegalArgumentException("Parameter 'sourceIFile' must not be null."); throw new IllegalArgumentException("Parameter 'sourceIFile' must not be null.");
} }
if (compilerPreferences == null) { if (languageHardwareCompilerDefinitionPreferences == null) {
throw new IllegalArgumentException("Parameter 'compilerPreferences' must not be null."); throw new IllegalArgumentException("Parameter 'compilerPreferences' must not be null.");
} }
this.mainSourceFile = new SourceFile(mainSourceIFile, mainSourceFileLanguageProperties); this.mainSourceFile = new SourceFile(mainSourceIFile, mainSourceFileLanguageProperties);
@ -132,9 +132,9 @@ public final class CompilerFiles {
// Output folder mode // Output folder mode
// Can be overridden via annotation property in main source file // Can be overridden via annotation property in main source file
String localOutputFolderPath = compilerPreferences.getOutputFolderPath(); String localOutputFolderPath = languageHardwareCompilerDefinitionPreferences.getOutputFolderPath();
String localOutputFolderMode = compilerPreferences.getOutputFolderMode(); String localOutputFolderMode = languageHardwareCompilerDefinitionPreferences.getOutputFolderMode();
String localOutputFileExtension = compilerPreferences.getOutputFileExtension(); String localOutputFileExtension = languageHardwareCompilerDefinitionPreferences.getOutputFileExtension();
// Properties which override the preferences // Properties which override the preferences
outputFolderModeProperty = mainSourceFileLanguageProperties.get(LanguageProperties.OUTPUT_FOLDER_MODE); outputFolderModeProperty = mainSourceFileLanguageProperties.get(LanguageProperties.OUTPUT_FOLDER_MODE);

View File

@ -43,30 +43,32 @@ public final class CompilerPaths {
public static final class CompilerPath { public static final class CompilerPath {
public final Language language; public final Language language;
public final String compilerId; public final CompilerDefinition compilerDefinition;
public final String os; public final String os;
public final String osArch; public final String osArch;
public final String executablePath; public final String executablePath;
private CompilerPath(Language language, String compilerId, String os, String osArch, String executablePath) { private CompilerPath(Language language, CompilerDefinition compilerDefinition, String os, String osArch,
String executablePath) {
this.language = language; this.language = language;
this.compilerId = compilerId; this.compilerDefinition = compilerDefinition;
this.os = os; this.os = os;
this.osArch = osArch; this.osArch = osArch;
this.executablePath = executablePath; this.executablePath = executablePath;
} }
public static String getKey(Language language, String compilerId, String os, String osArch) { public static String getKey(Language language, CompilerDefinition compilerDefinition, String os,
return language.name() + "/" + compilerId + "/" + os + "/" + osArch; String osArch) {
return language.name() + "/" + compilerDefinition.getId() + "/" + os + "/" + osArch;
} }
public String getKey() { public String getKey() {
return getKey(language, compilerId, os, osArch); return getKey(language, compilerDefinition, os, osArch);
} }
public String getRelativePath() { public String getRelativePath() {
return language.name() + "/" + compilerId.toUpperCase() + "/" + executablePath; return language.name() + "/" + compilerDefinition.getId().toUpperCase() + "/" + executablePath;
} }
public File getAbsoluteFile() { public File getAbsoluteFile() {
@ -81,6 +83,12 @@ public final class CompilerPaths {
* Created by the {@linkplain LanguagePlugin}. * Created by the {@linkplain LanguagePlugin}.
*/ */
public CompilerPaths() { public CompilerPaths() {
}
/**
* Initialize the default paths.
*/
public void init() {
compilerPaths = new TreeMap<String, CompilerPath>(); compilerPaths = new TreeMap<String, CompilerPath>();
// See https://github.com/peterdell/wudsn-ide-tools // See https://github.com/peterdell/wudsn-ide-tools
// TODO: Add MERLIN32 // TODO: Add MERLIN32
@ -116,20 +124,27 @@ public final class CompilerPaths {
if (!compilerId.equals(compilerId.toLowerCase())) { if (!compilerId.equals(compilerId.toLowerCase())) {
throw new IllegalArgumentException("Parameter 'compilerId' value " + compilerId + " must be lower case."); throw new IllegalArgumentException("Parameter 'compilerId' value " + compilerId + " must be lower case.");
} }
CompilerPath compilerPath = new CompilerPath(language, compilerId, os, osArch, executablePath); var compilerDefinition = LanguagePlugin.getInstance().getCompilerRegistry().getCompilerDefinitionById(language, compilerId);
CompilerPath compilerPath = new CompilerPath(language, compilerDefinition, os, osArch, executablePath);
compilerPaths.put(compilerPath.getKey(), compilerPath); compilerPaths.put(compilerPath.getKey(), compilerPath);
} }
public CompilerPath getDefaultCompilerPath(Language language, String compilerId) { public CompilerPath getDefaultCompilerPath(Language language, CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
String os = Platform.getOS(); String os = Platform.getOS();
String osArch = Platform.getOSArch(); String osArch = Platform.getOSArch();
String key = CompilerPath.getKey(language, compilerId, os, osArch); String key = CompilerPath.getKey(language, compilerDefinition, os, osArch);
CompilerPath compilerPath = compilerPaths.get(key); CompilerPath compilerPath = compilerPaths.get(key);
// Default to 32-bit version if 64-bit version not defined? // Default to 32-bit version if 64-bit version not defined?
if (compilerPath == null) { if (compilerPath == null) {
if (osArch.equals(Platform.ARCH_X86_64)) { if (osArch.equals(Platform.ARCH_X86_64)) {
osArch = Platform.ARCH_X86; osArch = Platform.ARCH_X86;
key = CompilerPath.getKey(language, compilerId, os, osArch); key = CompilerPath.getKey(language, compilerDefinition, os, osArch);
compilerPath = compilerPaths.get(key); compilerPath = compilerPaths.get(key);
} }
} }
@ -140,16 +155,16 @@ public final class CompilerPaths {
return Collections.unmodifiableList(new ArrayList<CompilerPath>(compilerPaths.values())); return Collections.unmodifiableList(new ArrayList<CompilerPath>(compilerPaths.values()));
} }
public List<CompilerPath> getCompilerPaths(Language language, String id) { public List<CompilerPath> getCompilerPaths(Language language, String compilerId) {
if (language == null) { if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null."); throw new IllegalArgumentException("Parameter 'language' must not be null.");
} }
if (id == null) { if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'id' must not be null."); throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
} }
List<CompilerPath> result = new ArrayList<>(); List<CompilerPath> result = new ArrayList<>();
for (CompilerPath compilerPath : compilerPaths.values()) { for (CompilerPath compilerPath : compilerPaths.values()) {
if (compilerPath.language.equals(language) && compilerPath.compilerId.equals(id)) { if (compilerPath.language.equals(language) && compilerPath.compilerDefinition.getId().equals(compilerId)) {
result.add(compilerPath); result.add(compilerPath);
} }
} }

View File

@ -49,7 +49,7 @@ public final class CompilerPathsTest {
filePath = file.getAbsolutePath(); filePath = file.getAbsolutePath();
result = file.exists() ? "found" : "NOT found"; result = file.exists() ? "found" : "NOT found";
} }
Test.log("Language " + compilerPath.language + ", compiler " + compilerPath.compilerId + ", OS " Test.log("Language " + compilerPath.language.name() + ", compiler " + compilerPath.compilerDefinition.getId() + ", OS "
+ compilerPath.os + ", OS architecture " + compilerPath.osArch + ": File " + filePath + " " + compilerPath.os + ", OS architecture " + compilerPath.osArch + ": File " + filePath + " "
+ result); + result);
} }

View File

@ -244,7 +244,7 @@ public final class CompilerRegistry {
* *
* @return The compiler, not <code>null</code>. * @return The compiler, not <code>null</code>.
*/ */
public Compiler getCompilerByKey(String key) { private Compiler getCompilerByKey(String key) {
if (key == null) { if (key == null) {
throw new IllegalArgumentException("Parameter 'key' must not be null."); throw new IllegalArgumentException("Parameter 'key' must not be null.");
} }
@ -260,4 +260,17 @@ public final class CompilerRegistry {
return result; return result;
} }
/**
* Gets the compiler for a given language and compiler Id
*
* @param language The language, not <code>null</code>.
* @param compilerId The compiler Id, not empty and not <code>null</code>.
*
* @return The compiler definition, not <code>null</code>.
*/
public CompilerDefinition getCompilerDefinitionById(Language language, String compilerId) {
var key = CompilerDefinition.getKey(language, compilerId);
return getCompilerByKey(key).getDefinition();
}
} }

View File

@ -66,7 +66,7 @@ import com.wudsn.ide.lng.compiler.parser.CompilerSourceParser;
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObject; import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObject;
import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner; import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner;
import com.wudsn.ide.lng.outline.LanguageOutlinePage; import com.wudsn.ide.lng.outline.LanguageOutlinePage;
import com.wudsn.ide.lng.preferences.CompilerPreferences; import com.wudsn.ide.lng.preferences.LanguageHardwareCompilerDefinitionPreferences;
import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.LanguagePreferences;
/** /**
@ -154,7 +154,7 @@ public abstract class LanguageEditor extends TextEditor {
} }
return plugin; return plugin;
} }
/** /**
* Gets the language. * Gets the language.
* *
@ -178,8 +178,8 @@ public abstract class LanguageEditor extends TextEditor {
* *
* @return The compiler preferences, not <code>null</code>. * @return The compiler preferences, not <code>null</code>.
*/ */
public final CompilerPreferences getCompilerPreferences() { public final LanguageHardwareCompilerDefinitionPreferences getLanguageHardwareCompilerPreferences() {
return getLanguagePreferences().getCompilerPreferences(getCompilerDefinition(), getHardware()); return getLanguagePreferences().getLanguageHardwareCompilerDefinitionPreferences(getHardware(), getCompilerDefinition());
} }
/** /**
@ -220,7 +220,7 @@ public abstract class LanguageEditor extends TextEditor {
if (compiler == null) { if (compiler == null) {
throw new IllegalStateException("Field 'compiler' must not be null."); throw new IllegalStateException("Field 'compiler' must not be null.");
} }
target = getCompilerPreferences().getTarget(); target = getLanguageHardwareCompilerPreferences().getTarget();
result = compiler.createSourceParser(); result = compiler.createSourceParser();
result.init(compiler.getDefinition().getSyntax().getInstructionSet(target)); result.init(compiler.getDefinition().getSyntax().getInstructionSet(target));
return result; return result;
@ -429,13 +429,12 @@ public abstract class LanguageEditor extends TextEditor {
} else { } else {
newIdentifiers = compilerSourceFile.getIdentifiers(); newIdentifiers = compilerSourceFile.getIdentifiers();
} }
LanguageSourceViewerConfiguration asvc; LanguageSourceViewerConfiguration asvc;
LanguageSourceScanner ais; LanguageSourceScanner ais;
asvc = (LanguageSourceViewerConfiguration) getSourceViewerConfiguration(); asvc = (LanguageSourceViewerConfiguration) getSourceViewerConfiguration();
ais = asvc.getInstructionScanner(); ais = asvc.getInstructionScanner();
ais.setIdentifiers(newIdentifiers); ais.setIdentifiers(newIdentifiers);
profiler.begin("refreshSourceViewer"); profiler.begin("refreshSourceViewer");
// refreshSourceViewer(); TODO Required? // refreshSourceViewer(); TODO Required?

View File

@ -218,7 +218,7 @@ final class LanguageEditorCompileCommand {
// Create wrapper for run properties. // Create wrapper for run properties.
CompilerDefinition compilerDefinition = languageEditor.getCompilerDefinition(); CompilerDefinition compilerDefinition = languageEditor.getCompilerDefinition();
CompilerRunPreferences compilerRunPreferences = new CompilerRunPreferences( CompilerRunPreferences compilerRunPreferences = new CompilerRunPreferences(
languageEditor.getCompilerPreferences(), files.mainSourceFile.languageProperties); languageEditor.getLanguageHardwareCompilerPreferences(), files.mainSourceFile.languageProperties);
// Check if output file is modifiable in case it already exists. // Check if output file is modifiable in case it already exists.
long outputFileLastModified = -1; long outputFileLastModified = -1;
@ -248,21 +248,20 @@ final class LanguageEditorCompileCommand {
// Get and check path to compiler executable. // Get and check path to compiler executable.
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage()); String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage());
String compilerExecutablePath = languageEditor.getLanguagePreferences()
String compilerExecutablePath = languageEditor.getCompilerPreferences().getCompilerExecutablePathOrDefault(); .getCompilerExecutablePathOrDefault(compilerDefinition);
if (StringUtility.isEmpty(compilerExecutablePath)) { if (StringUtility.isEmpty(compilerExecutablePath)) {
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences. // ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100, createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100, compilerDefinition.getText(),
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText); compilerDefinition.getName(), compilerPreferencesText);
return false; return false;
} }
File compilerExecutableFile = new File(compilerExecutablePath); File compilerExecutableFile = new File(compilerExecutablePath);
if (!compilerExecutableFile.exists()) { if (!compilerExecutableFile.exists()) {
// ERROR: Path to {0} '{1}' executable in the '{2}' preferences points to // ERROR: Path to {0} '{1}' executable in the '{2}' preferences points to
// non-existing file '{3}'. // non-existing file '{3}'.
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103, createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103, compilerDefinition.getText(),
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText, compilerDefinition.getName(), compilerPreferencesText, compilerExecutablePath);
compilerExecutablePath);
return false; return false;
} }
@ -282,8 +281,8 @@ final class LanguageEditorCompileCommand {
String compilerParameterArray[] = compilerParameters.split(" "); String compilerParameterArray[] = compilerParameters.split(" ");
if (compilerParameterArray.length == 0) { if (compilerParameterArray.length == 0) {
// ERROR: The {0} '{1}' does not specify default parameters. // ERROR: The {0} '{1}' does not specify default parameters.
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101, createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101, compilerDefinition.getText(),
compilerDefinition.getText(), compilerDefinition.getName()); compilerDefinition.getName());
return false; return false;
} }
@ -323,9 +322,9 @@ final class LanguageEditorCompileCommand {
} catch (IOException ex) { } catch (IOException ex) {
// ERROR: Cannot execute {0} process '{1}' in working directory '{2}'. System // ERROR: Cannot execute {0} process '{1}' in working directory '{2}'. System
// error: {3} // error: {3}
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105, createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105, compilerDefinition.getText(),
compilerDefinition.getText(), compilerProcess.getCommandArrayString(), compilerProcess.getCommandArrayString(), compilerProcess.getWorkingDirectory().getPath(),
compilerProcess.getWorkingDirectory().getPath(), ex.getMessage()); ex.getMessage());
} }
// Refresh the output and the symbols file resource. // Refresh the output and the symbols file resource.
@ -403,8 +402,7 @@ final class LanguageEditorCompileCommand {
if (!compilerSuccess && !errorFound) { if (!compilerSuccess && !errorFound) {
// ERROR: {0} process ended with return code {1}. Check the error messages and // ERROR: {0} process ended with return code {1}. Check the error messages and
// the console log. // the console log.
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127, createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127, compilerDefinition.getText(),
compilerDefinition.getText(),
NumberUtility.getLongValueDecimalString(compilerProcess.getExitValue())); NumberUtility.getLongValueDecimalString(compilerProcess.getExitValue()));
} }

View File

@ -40,7 +40,7 @@ import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.base.hardware.HardwareUtility; import com.wudsn.ide.base.hardware.HardwareUtility;
import com.wudsn.ide.lng.LanguagePlugin; import com.wudsn.ide.lng.LanguagePlugin;
import com.wudsn.ide.lng.Texts; import com.wudsn.ide.lng.Texts;
import com.wudsn.ide.lng.preferences.CompilerPreferences; import com.wudsn.ide.lng.preferences.LanguageHardwareCompilerDefinitionPreferences;
import com.wudsn.ide.lng.runner.RunnerDefinition; import com.wudsn.ide.lng.runner.RunnerDefinition;
import com.wudsn.ide.lng.runner.RunnerId; import com.wudsn.ide.lng.runner.RunnerId;
import com.wudsn.ide.lng.runner.RunnerRegistry; import com.wudsn.ide.lng.runner.RunnerRegistry;
@ -110,7 +110,7 @@ public final class LanguageEditorCompileCommandDelegate
RunnerRegistry runnerRegistry = languagePlugin.getRunnerRegistry(); RunnerRegistry runnerRegistry = languagePlugin.getRunnerRegistry();
Hardware hardware = languageEditor.getHardware(); Hardware hardware = languageEditor.getHardware();
List<RunnerDefinition> runnerDefinitions = runnerRegistry.getDefinitions(hardware); List<RunnerDefinition> runnerDefinitions = runnerRegistry.getDefinitions(hardware);
CompilerPreferences compilerPreferences = languageEditor.getCompilerPreferences(); LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences = languageEditor.getLanguageHardwareCompilerPreferences();
Menu menu = new Menu(parent); Menu menu = new Menu(parent);
setMenu(menu); setMenu(menu);
@ -123,7 +123,7 @@ public final class LanguageEditorCompileCommandDelegate
String runnerName = runnerDefinition.getName(); String runnerName = runnerDefinition.getName();
// The system default application does not need an executable path. // The system default application does not need an executable path.
if (!runnerId.equals(RunnerId.DEFAULT_APPLICATION)) { if (!runnerId.equals(RunnerId.DEFAULT_APPLICATION)) {
if (StringUtility.isEmpty(compilerPreferences.getRunnerExecutablePath(runnerId))) { if (StringUtility.isEmpty(languageHardwareCompilerDefinitionPreferences.getRunnerExecutablePath(runnerId))) {
continue; continue;
} }
} }
@ -131,7 +131,7 @@ public final class LanguageEditorCompileCommandDelegate
Action action = new CompileAndRunAction(runnerId); Action action = new CompileAndRunAction(runnerId);
action.setActionDefinitionId(LanguageEditorCompileCommand.COMPILE_AND_RUN_WITH); action.setActionDefinitionId(LanguageEditorCompileCommand.COMPILE_AND_RUN_WITH);
action.setImageDescriptor(imageDescriptor); action.setImageDescriptor(imageDescriptor);
if (runnerId.equals(compilerPreferences.getRunnerId())) { if (runnerId.equals(languageHardwareCompilerDefinitionPreferences.getRunnerId())) {
runnerName = runnerName + " " + Texts.COMPILER_TOOLBAR_RUN_WITH_DEFAULT_LABEL; runnerName = runnerName + " " + Texts.COMPILER_TOOLBAR_RUN_WITH_DEFAULT_LABEL;
} }
action.setText(runnerName); action.setText(runnerName);

View File

@ -45,8 +45,8 @@ public final class LanguageEditorCompilerHelpCommandHandler extends AbstractHand
var languageEditor = (LanguageEditor) editor; var languageEditor = (LanguageEditor) editor;
var compilerDefinition = languageEditor.getCompilerDefinition(); var compilerDefinition = languageEditor.getCompilerDefinition();
var compilerPreferences = languageEditor.getCompilerPreferences(); var languagePreferences = languageEditor.getLanguagePreferences();
var compilerExecutablePath = compilerPreferences.getCompilerExecutablePathOrDefault(); var compilerExecutablePath = languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition);
try { try {
var helpDocument = compilerDefinition.getInstalledHelpForCurrentLocale(compilerExecutablePath); var helpDocument = compilerDefinition.getInstalledHelpForCurrentLocale(compilerExecutablePath);

View File

@ -120,7 +120,7 @@ public final class LanguageEditorFilesLogic {
} }
} }
result = new CompilerFiles(mainSourceIFile, mainSourceFileProperties, sourceIFile, sourceFileProperties, result = new CompilerFiles(mainSourceIFile, mainSourceFileProperties, sourceIFile, sourceFileProperties,
languageEditor.getCompilerPreferences()); languageEditor.getLanguageHardwareCompilerPreferences());
} else { } else {
result = null; result = null;
} }

View File

@ -47,22 +47,21 @@ final class LanguageRuleBasedScanner extends RuleBasedScanner {
* Creates a new instance. Called by {@link LanguageSourceViewerConfiguration}. * Creates a new instance. Called by {@link LanguageSourceViewerConfiguration}.
* *
* @param languagePreferences The language preferences, not <code>null</code>. * @param languagePreferences The language preferences, not <code>null</code>.
* @param textAttributeName The text attribute name to listen to for text * @param preferencesKey The preferences key to listen to for text
* attribute changes, not <code>null</code>. See * attribute changes, not <code>null</code>. See
* {@link LanguagePreferencesConstants} * {@link LanguagePreferencesConstants}
*/ */
LanguageRuleBasedScanner(LanguagePreferences languagePreferences, String textAttributeName) { LanguageRuleBasedScanner(LanguagePreferences languagePreferences, String preferencesKey) {
if (languagePreferences == null) { if (languagePreferences == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null."); throw new IllegalArgumentException("Parameter 'language' must not be null.");
} }
if (textAttributeName == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
this.preferencesKey = LanguagePreferencesConstants.getPreferencesKey(languagePreferences.getLanguage(), this.preferencesKey = preferencesKey;
textAttributeName);
defaultToken = new Token(languagePreferences.getEditorTextAttribute(textAttributeName)); defaultToken = new Token(languagePreferences.getTextAttribute(preferencesKey));
super.setDefaultReturnToken(defaultToken); super.setDefaultReturnToken(defaultToken);
} }
@ -94,7 +93,7 @@ final class LanguageRuleBasedScanner extends RuleBasedScanner {
boolean refresh = false; boolean refresh = false;
if (changedPropertyNames.contains(preferencesKey)) { if (changedPropertyNames.contains(preferencesKey)) {
TextAttributeConverter.dispose((TextAttribute) defaultToken.getData()); TextAttributeConverter.dispose((TextAttribute) defaultToken.getData());
defaultToken.setData(preferences.getLanguagesPreferences().getEditorTextAttribute(preferencesKey)); defaultToken.setData(preferences.getTextAttribute(preferencesKey));
refresh = true; refresh = true;
} }
return refresh; return refresh;

View File

@ -41,8 +41,10 @@ import com.wudsn.ide.lng.compiler.syntax.Instruction;
import com.wudsn.ide.lng.compiler.syntax.InstructionSet; import com.wudsn.ide.lng.compiler.syntax.InstructionSet;
import com.wudsn.ide.lng.compiler.syntax.InstructionType; import com.wudsn.ide.lng.compiler.syntax.InstructionType;
import com.wudsn.ide.lng.compiler.syntax.Opcode; import com.wudsn.ide.lng.compiler.syntax.Opcode;
import com.wudsn.ide.lng.preferences.LanguageHardwareCompilerDefinitionPreferencesConstants;
import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.LanguagePreferences;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants; import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
import com.wudsn.ide.lng.preferences.TextAttributeConverter; import com.wudsn.ide.lng.preferences.TextAttributeConverter;
/** /**
@ -397,27 +399,27 @@ final class LanguageSourceScanner extends RuleBasedScanner {
private void createTokens() { private void createTokens() {
// Numbers // Numbers
numberToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER); numberToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER);
// Instructions // Instructions
directiveToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE); directiveToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE);
legalOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL); legalOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL);
illegalOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL); illegalOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL);
pseudoOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO); pseudoOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO);
// Identifiers // Identifiers
equateIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE); equateIdentifierToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE);
labelIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL); labelIdentifierToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL);
enumDefinitionSectionIdentifierToken = createToken( enumDefinitionSectionIdentifierToken = createLanguageToken(
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION); EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION);
structureDefinitionSectionIdentifierToken = createToken( structureDefinitionSectionIdentifierToken = createLanguageToken(
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION); EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION);
localSectionIdentifierToken = createToken( localSectionIdentifierToken = createLanguageToken(
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION); EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION);
macroDefinitionSectionIdentifierToken = createToken( macroDefinitionSectionIdentifierToken = createLanguageToken(
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION); EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION);
procedureDefinitionSectionIdentifierToken = createToken( procedureDefinitionSectionIdentifierToken = createLanguageToken(
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION); EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION);
} }
@ -428,14 +430,13 @@ final class LanguageSourceScanner extends RuleBasedScanner {
* <code>null</code>. * <code>null</code>.
* @return The new token, not <code>null</code>. * @return The new token, not <code>null</code>.
*/ */
private IToken createToken(String textAttributeName) { private IToken createLanguageToken(String textAttributeName) {
if (textAttributeName == null) { if (textAttributeName == null) {
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null."); throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null.");
} }
LanguagePreferences preferences = editor.getLanguagePreferences(); var preferences = editor.getLanguagePreferences();
String preferencesKey = LanguagePreferencesConstants.getPreferencesKey(preferences.getLanguage(), var preferencesKey = EditorConstants.getEditorAttributeKey(preferences.getLanguage(), textAttributeName);
textAttributeName); var token = new Token(preferences.getTextAttribute(preferencesKey));
Token token = new Token(preferences.getEditorTextAttribute(textAttributeName));
tokens.put(preferencesKey, token); tokens.put(preferencesKey, token);
return token; return token;
} }
@ -482,27 +483,29 @@ final class LanguageSourceScanner extends RuleBasedScanner {
* {@link LanguageSourceViewerConfiguration}. * {@link LanguageSourceViewerConfiguration}.
* *
* @param preferences The preferences, not <code>null</code>. * @param preferences The preferences, not <code>null</code>.
* @param changedPropertyNames The set of changed property names, not * @param changedPreferencesKeys The set of changed property names, not
* <code>null</code>. * <code>null</code>.
* *
* @return <code>true</code> If the editor has to be refreshed. * @return <code>true</code> If the editor has to be refreshed.
*/ */
final boolean preferencesChanged(LanguagePreferences preferences, Set<String> changedPropertyNames) { final boolean preferencesChanged(LanguagePreferences preferences, Set<String> changedPreferencesKeys) {
if (preferences == null) { if (preferences == null) {
throw new IllegalArgumentException("Parameter 'preferences' must not be null."); throw new IllegalArgumentException("Parameter 'preferences' must not be null.");
} }
if (changedPropertyNames == null) { if (changedPreferencesKeys == null) {
throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null."); throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null.");
} }
boolean refresh = false; boolean refresh = false;
for (String propertyName : changedPropertyNames) { var compilerTargetPreferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
Token token = tokens.get(propertyName); .getCompilerTargetName(editor.getLanguage(), editor.getHardware(), editor.getCompilerDefinition());
for (String preferencesKey : changedPreferencesKeys) {
Token token = tokens.get(preferencesKey);
if (token != null) { if (token != null) {
TextAttributeConverter.dispose((TextAttribute) token.getData()); TextAttributeConverter.dispose((TextAttribute) token.getData());
token.setData(preferences.getLanguagesPreferences().getEditorTextAttribute(propertyName)); token.setData(preferences.getTextAttribute(preferencesKey));
refresh = true; refresh = true;
} else if (LanguagePreferencesConstants.isCompilerTargetName(propertyName)) { } else if (compilerTargetPreferencesKey.equals(preferencesKey)) {
CompilerSourceParser compilerSourceParser = editor.createCompilerSourceParser(); CompilerSourceParser compilerSourceParser = editor.createCompilerSourceParser();
wordRule.setCompilerSourceParser(compilerSourceParser); wordRule.setCompilerSourceParser(compilerSourceParser);
wordRule.setInstructions(); wordRule.setInstructions();

View File

@ -40,7 +40,7 @@ import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner; import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner;
import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.LanguagePreferences;
import com.wudsn.ide.lng.preferences.LanguagePreferencesChangeListener; import com.wudsn.ide.lng.preferences.LanguagePreferencesChangeListener;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants; import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
/** /**
* Source configuration for the language editor. Provides syntax highlighting. * Source configuration for the language editor. Provides syntax highlighting.
@ -140,7 +140,7 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
if (changedPropertyNames == null) { if (changedPropertyNames == null) {
throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null."); throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null.");
} }
boolean refresh = false; var refresh = false;
refresh |= commentSingleScanner.preferencesChanged(preferences, changedPropertyNames); refresh |= commentSingleScanner.preferencesChanged(preferences, changedPropertyNames);
refresh |= commentMultipleScanner.preferencesChanged(preferences, changedPropertyNames); refresh |= commentMultipleScanner.preferencesChanged(preferences, changedPropertyNames);
refresh |= stringScanner.preferencesChanged(preferences, changedPropertyNames); refresh |= stringScanner.preferencesChanged(preferences, changedPropertyNames);
@ -168,25 +168,26 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
if (sourceViewer == null) { if (sourceViewer == null) {
throw new IllegalArgumentException("Parameter 'sourceViewer' must not be null."); throw new IllegalArgumentException("Parameter 'sourceViewer' must not be null.");
} }
PresentationReconciler reconciler = new PresentationReconciler(); var reconciler = new PresentationReconciler();
DefaultDamagerRepairer dr;
LanguagePreferences languagePreferences = editor.getLanguagePreferences(); var languagePreferences = editor.getLanguagePreferences();
var language = languagePreferences.getLanguage();
commentSingleScanner = new LanguageRuleBasedScanner(languagePreferences, var preferencesKey = EditorConstants.getEditorAttributeKey(language,
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT); EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
dr = new DefaultDamagerRepairer(commentSingleScanner); commentSingleScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
var dr = new DefaultDamagerRepairer(commentSingleScanner);
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
commentMultipleScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey = EditorConstants.getEditorAttributeKey(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT); commentMultipleScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
dr = new DefaultDamagerRepairer(commentMultipleScanner); dr = new DefaultDamagerRepairer(commentMultipleScanner);
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
stringScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey = EditorConstants.getEditorAttributeKey(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_STRING);
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING); stringScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
dr = new DefaultDamagerRepairer(stringScanner); dr = new DefaultDamagerRepairer(stringScanner);
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_STRING); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_STRING); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
@ -206,16 +207,18 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
} }
IReconcilingStrategy reconcilingStrategy = new LanguageReconcilingStategy(editor); IReconcilingStrategy reconcilingStrategy = new LanguageReconcilingStategy(editor);
MonoReconciler reconciler = new MonoReconciler(reconcilingStrategy, false); var reconciler = new MonoReconciler(reconcilingStrategy, false);
reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setProgressMonitor(new NullProgressMonitor());
reconciler.setDelay(500); // TODO Compute delay based on size of content on the source viewer (sourceViewer.getDocument().getLength()) or the fact that the parser is still parsing reconciler.setDelay(500); // TODO Compute delay based on size of content on the source viewer
// (sourceViewer.getDocument().getLength()) or the fact that the parser is still
// parsing
return reconciler; return reconciler;
} }
@Override @Override
protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) { protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
Map<String, IAdaptable> targets = super.getHyperlinkDetectorTargets(sourceViewer); var targets = super.getHyperlinkDetectorTargets(sourceViewer);
targets.put(LanguageHyperlinkDetector.TARGET, editor); targets.put(LanguageHyperlinkDetector.TARGET, editor);
return targets; return targets;
} }

View File

@ -64,7 +64,6 @@ import com.wudsn.ide.lng.compiler.syntax.InstructionSet;
import com.wudsn.ide.lng.compiler.syntax.InstructionType; import com.wudsn.ide.lng.compiler.syntax.InstructionType;
import com.wudsn.ide.lng.compiler.syntax.Opcode; import com.wudsn.ide.lng.compiler.syntax.Opcode;
import com.wudsn.ide.lng.compiler.syntax.Opcode.OpcodeAddressingMode; import com.wudsn.ide.lng.compiler.syntax.Opcode.OpcodeAddressingMode;
import com.wudsn.ide.lng.preferences.CompilerPreferences;
import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.LanguagePreferences;
import com.wudsn.ide.lng.runner.RunnerDefinition; import com.wudsn.ide.lng.runner.RunnerDefinition;
import com.wudsn.ide.lng.runner.RunnerId; import com.wudsn.ide.lng.runner.RunnerId;
@ -301,20 +300,16 @@ public final class LanguageHelpContentProducer implements IHelpContentProducer {
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry(); CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
// Find non-empty compiler executable path. // Find non-empty compiler executable path.
Language language = Language.valueOf(languageString); var language = Language.valueOf(languageString);
String compilerKey = CompilerDefinition.getKey(language, compilerId); var compilerDefinition = compilerRegistry.getCompilerDefinitionById(language, compilerId);
CompilerDefinition compilerDefinition = compilerRegistry.getCompilerByKey(compilerKey).getDefinition();
if (section.startsWith(SECTION_GENERAL)) { if (section.startsWith(SECTION_GENERAL)) {
return getInputStream(getCompilerGeneralSection(compilerDefinition)); return getInputStream(getCompilerGeneralSection(compilerDefinition));
} else if (section.startsWith(SECTION_MANUAL)) { } else if (section.startsWith(SECTION_MANUAL)) {
LanguagePreferences languagePreferences = languagePlugin.getLanguagePreferences(language); LanguagePreferences languagePreferences = languagePlugin.getLanguagePreferences(language);
CompilerPreferences compilerPreferences = languagePreferences.getCompilerPreferences(compilerDefinition,
Hardware.GENERIC);
try { try {
var helpDocDocument = compilerDefinition var helpDocDocument = compilerDefinition.getInstalledHelpForCurrentLocale(
.getInstalledHelpForCurrentLocale(compilerPreferences.getCompilerExecutablePathOrDefault()); languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition));
File file = helpDocDocument.file; File file = helpDocDocument.file;
if (file == null) { if (file == null) {
throw new RuntimeException( throw new RuntimeException(

View File

@ -262,8 +262,7 @@ public final class LanguageTocProvider extends AbstractTocProvider {
var languagePreferences = LanguagePlugin.getInstance() var languagePreferences = LanguagePlugin.getInstance()
.getLanguagePreferences(compilerDefinition.getLanguage()); .getLanguagePreferences(compilerDefinition.getLanguage());
var compilerPreferences = languagePreferences.getCompilerPreferences(compilerDefinition, Hardware.GENERIC); var compilerExecutablePath = languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition);
var compilerExecutablePath = compilerPreferences.getCompilerExecutablePathOrDefault();
var icon = ""; var icon = "";
var manualTopics = new ArrayList<ITopic>(); var manualTopics = new ArrayList<ITopic>();

View File

@ -32,18 +32,18 @@ import com.wudsn.ide.lng.LanguageProperties;
*/ */
public final class CompilerRunPreferences { public final class CompilerRunPreferences {
private CompilerPreferences compilerPreferences; private LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences;
private LanguageProperties mainSourceFileProperties; private LanguageProperties mainSourceFileProperties;
public CompilerRunPreferences(CompilerPreferences compilerPreferences, public CompilerRunPreferences(LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences,
LanguageProperties mainSourceFileProperties) { LanguageProperties mainSourceFileProperties) {
if (compilerPreferences == null) { if (languageHardwareCompilerDefinitionPreferences == null) {
throw new IllegalArgumentException("Parameter 'compilerPreferences' must not be null."); throw new IllegalArgumentException("Parameter 'languageHardwareCompilerDefinitionPreferences' must not be null.");
} }
if (mainSourceFileProperties == null) { if (mainSourceFileProperties == null) {
throw new IllegalArgumentException("Parameter 'properties' must not be null."); throw new IllegalArgumentException("Parameter 'properties' must not be null.");
} }
this.compilerPreferences = compilerPreferences; this.languageHardwareCompilerDefinitionPreferences = languageHardwareCompilerDefinitionPreferences;
this.mainSourceFileProperties = mainSourceFileProperties; this.mainSourceFileProperties = mainSourceFileProperties;
} }
@ -55,7 +55,7 @@ public final class CompilerRunPreferences {
* @since 1.6.1 * @since 1.6.1
*/ */
public Hardware getHardware() { public Hardware getHardware() {
return compilerPreferences.getHardware(); return languageHardwareCompilerDefinitionPreferences.getHardware();
} }
/** /**
@ -68,7 +68,7 @@ public final class CompilerRunPreferences {
String result; String result;
result = compilerPreferences.getParameters(); result = languageHardwareCompilerDefinitionPreferences.getParameters();
return result; return result;
} }
@ -81,7 +81,7 @@ public final class CompilerRunPreferences {
public String getRunnerId() { public String getRunnerId() {
String result; String result;
result = compilerPreferences.getRunnerId(); result = languageHardwareCompilerDefinitionPreferences.getRunnerId();
return result; return result;
} }
@ -103,7 +103,7 @@ public final class CompilerRunPreferences {
String result; String result;
result = compilerPreferences.getRunnerExecutablePath(runnerId); result = languageHardwareCompilerDefinitionPreferences.getRunnerExecutablePath(runnerId);
return result; return result;
} }
@ -122,7 +122,7 @@ public final class CompilerRunPreferences {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty."); throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
} }
String result; String result;
result = compilerPreferences.getRunnerCommandLine(runnerId); result = languageHardwareCompilerDefinitionPreferences.getRunnerCommandLine(runnerId);
return result; return result;
} }
@ -144,7 +144,7 @@ public final class CompilerRunPreferences {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty."); throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
} }
boolean result; boolean result;
result = compilerPreferences.isRunnerWaitForCompletion(runnerId); result = languageHardwareCompilerDefinitionPreferences.isRunnerWaitForCompletion(runnerId);
return result; return result;
} }

View File

@ -1,281 +1,222 @@
/** /**
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.preferences; package com.wudsn.ide.lng.preferences;
import java.io.File; import com.wudsn.ide.base.common.StringUtility;
import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.base.common.StringUtility; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.lng.Target;
import com.wudsn.ide.lng.LanguagePlugin; import com.wudsn.ide.lng.compiler.CompilerDefinition;
import com.wudsn.ide.lng.Target; import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode;
import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode; import com.wudsn.ide.lng.runner.RunnerId;
import com.wudsn.ide.lng.compiler.CompilerPaths;
import com.wudsn.ide.lng.compiler.CompilerPaths.CompilerPath; /**
import com.wudsn.ide.lng.runner.RunnerId; * Facade class for typed access to the global compiler preferences for a given
* hardware.
/** *
* Facade class for typed access to the global compiler preferences for a given * @author Peter Dell
* hardware. */
* public final class LanguageHardwareCompilerDefinitionPreferences {
* @author Peter Dell
*/ private LanguagePreferences languagePreferences;
public final class CompilerPreferences { private Language language;
private Hardware hardware;
private LanguagePreferences languagePreferences; private CompilerDefinition compilerDefinition;
private Hardware hardware;
private String compilerId; LanguageHardwareCompilerDefinitionPreferences(LanguagePreferences languagePreferences, Hardware hardware,
CompilerDefinition compilerDefinition) {
CompilerPreferences(LanguagePreferences languagePreferences, String compilerId, Hardware hardware) { if (languagePreferences == null) {
if (languagePreferences == null) { throw new IllegalArgumentException("Parameter 'languagePreferences' must not be null.");
throw new IllegalArgumentException("Parameter 'languagePreferences' must not be null."); }
} if (compilerDefinition == null) {
if (compilerId == null) { throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
throw new IllegalArgumentException("Parameter 'compilerId' must not be null."); }
} if (hardware == null) {
if (StringUtility.isEmpty(compilerId)) { throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
throw new IllegalArgumentException("Parameter 'compilerId' must not be empty."); }
} this.languagePreferences = languagePreferences;
if (hardware == null) { this.language = this.languagePreferences.getLanguage();
throw new IllegalArgumentException("Parameter 'hardware' must not be null."); this.compilerDefinition = compilerDefinition;
} this.hardware = hardware;
this.languagePreferences = languagePreferences; }
this.compilerId = compilerId;
this.hardware = hardware; /**
} * Gets the hardware for which the compiler is invoked.
*
/** * @return The hardware, not <code>null</code>.
* Gets the compiler id of the compiler. *
* * @since 1.6.1
* @return The compiler id of the compiler, not empty and not <code>null</code>. */
*/ public Hardware getHardware() {
public String getCompilerId() { return hardware;
return compilerId; }
}
/**
/** * Gets the compiler definition.
* Gets the configured executable path for the compiler. *
* * @return The compiler definition, not <code>null</code>.
* @return The executable path for the runner, may be empty, not */
* <code>null</code>. public CompilerDefinition getCompilerDefinition() {
*/ return compilerDefinition;
public String getCompilerExecutablePath() { }
return languagePreferences.getString(LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId));
} /**
* Gets the Target for which the instructions shall be active.
/** *
* Gets the executable path for the compiler. * @return The Target, not <code>null</code>.
* *
* @return The executable path for the runner, may be empty, not * @since 1.6.1
* <code>null</code>. */
*/ public Target getTarget() {
public String getCompilerExecutablePathOrDefault() { Target result;
String compilerExecutablePath = getCompilerExecutablePath(); String targetString = languagePreferences
.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerTargetName(language, hardware, compilerDefinition));
CompilerPaths compilerPaths = LanguagePlugin.getInstance().getCompilerPaths();
if (StringUtility.isEmpty(compilerExecutablePath)) { if (StringUtility.isEmpty(targetString)) {
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(languagePreferences.getLanguage(), result = Target.MOS6502;
compilerId); } else {
if (compilerPath != null) { result = Target.valueOf(targetString);
File compilerFile = compilerPath.getAbsoluteFile(); }
if (compilerFile != null) { return result;
if (compilerFile.exists() && compilerFile.isFile() && compilerFile.canExecute()) { }
compilerExecutablePath = compilerFile.getAbsolutePath();
} /**
} * Gets the parameters for the compiler.
} *
* @return The parameters path for the compiler, may be empty, not
} * <code>null</code>.
return compilerExecutablePath; */
} public String getParameters() {
return languagePreferences.getString(
/** LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerParametersName(language, hardware, compilerDefinition));
* Gets the hardware for which the compiler is invoked. }
*
* @return The hardware, not <code>null</code>. /**
* * Gets the output folder mode for the compiler.
* @since 1.6.1 *
*/ * @return The output folder mode for the compiler, see
public Hardware getHardware() { * {@link CompilerOutputFolderMode}, may be empty, not
return hardware; * <code>null</code>.
} */
public String getOutputFolderMode() {
/**
* Gets the Target for which the instructions shall be active. return languagePreferences.getString(
* LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFolderModeName(language, hardware, compilerDefinition));
* @return The Target, not <code>null</code>. }
*
* @since 1.6.1 /**
*/ * Gets the output folder for the compiler in case the output folder mode is
public Target getTarget() { * {@link CompilerOutputFolderMode#FIXED_FOLDER}.
Target result; *
String targetString = languagePreferences * @return The output folder mode for the compiler, see
.getString(LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware)); * {@link CompilerOutputFolderMode#FIXED_FOLDER}, may be empty, not
* <code>null</code>.
if (StringUtility.isEmpty(targetString)) { */
result = Target.MOS6502; public String getOutputFolderPath() {
} else {
result = Target.valueOf(targetString); return languagePreferences.getString(
} LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFolderPathName(language, hardware, compilerDefinition));
return result; }
}
/**
/** * Gets the output file extension for the compiler.
* Determines if illegal opcodes shall be highlighted and proposed. *
* * @return The output file extension may be empty, not <code>null</code>.
* @return <code>true</code> if yet, <code>false</code> otherwise. */
*/ public String getOutputFileExtension() {
@Deprecated
public boolean isIllegalOpcodesVisible() { return languagePreferences.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFileExtensionName(language,
return getTarget() == Target.MOS6502_ILLEGAL; hardware, compilerDefinition));
} }
/** /**
* Determines if W65816 opcodes shall be highlighted and proposed. * Gets the id of the default runner to run the output file.
* *
* @return <code>true</code> if yet, <code>false</code> otherwise. * @return The id of the runner to run the output file, not empty and not
*/ * <code>null</code>.
@Deprecated */
public boolean isW65816OpcodesVisible() { public String getRunnerId() {
return getTarget() == Target.MOS65816; String result = languagePreferences.getString(
} LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerIdName(language, hardware, compilerDefinition));
if (StringUtility.isEmpty(result)) {
/** result = RunnerId.DEFAULT_APPLICATION;
* Gets the parameters for the compiler. }
* return result;
* @return The parameters path for the compiler, may be empty, not }
* <code>null</code>.
*/ /**
public String getParameters() { * Gets the executable path for the runner.
return languagePreferences *
.getString(LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware)); * @param runnerId The runner id, not empty and not <code>null</code>.
} *
* @return The executable path for the runner, may be empty, not
/** * <code>null</code>.
* Gets the output folder mode for the compiler. */
* public String getRunnerExecutablePath(String runnerId) {
* @return The output folder mode for the compiler, see if (runnerId == null) {
* {@link CompilerOutputFolderMode}, may be empty, not throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
* <code>null</code>. }
*/ if (StringUtility.isEmpty(runnerId)) {
public String getOutputFolderMode() { throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return languagePreferences return languagePreferences.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerExecutablePathName(language,
.getString(LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware)); hardware, compilerDefinition, runnerId));
} }
/** /**
* Gets the output folder for the compiler in case the output folder mode is * Gets the parameters for the runner.
* {@link CompilerOutputFolderMode#FIXED_FOLDER}. *
* * @param runnerId The runner id, not empty and not <code>null</code>.
* @return The output folder mode for the compiler, see *
* {@link CompilerOutputFolderMode#FIXED_FOLDER}, may be empty, not * @return The parameters for the runner, may be empty, not <code>null</code>.
* <code>null</code>. */
*/ public String getRunnerCommandLine(String runnerId) {
public String getOutputFolderPath() { if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
return languagePreferences }
.getString(LanguagePreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware)); if (StringUtility.isEmpty(runnerId)) {
} throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
/** return languagePreferences.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerCommandLineName(language,
* Gets the output file extension for the compiler. hardware, compilerDefinition, runnerId));
* }
* @return The output file extension may be empty, not <code>null</code>.
*/ /**
public String getOutputFileExtension() { * Gets the wait for completion indicator for the runner.
*
return languagePreferences * @param runnerId The runner id, not empty and not <code>null</code>.
.getString(LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware)); *
} * @return <code>true</code>if waiting for completion is requested,
* <code>false</code> otherwise.
/** *
* Gets the id of the default runner to run the output file. * @since 1.6.1
* */
* @return The id of the runner to run the output file, not empty and not public boolean isRunnerWaitForCompletion(String runnerId) {
* <code>null</code>. if (runnerId == null) {
*/ throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
public String getRunnerId() { }
String result = languagePreferences if (StringUtility.isEmpty(runnerId)) {
.getString(LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware)); throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
if (StringUtility.isEmpty(result)) { }
result = RunnerId.DEFAULT_APPLICATION; return languagePreferences.getBoolean(LanguageHardwareCompilerDefinitionPreferencesConstants
} .getCompilerRunnerWaitForCompletionName(language, hardware, compilerDefinition, runnerId));
return result; }
}
}
/**
* Gets the executable path for the runner.
*
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return The executable path for the runner, may be empty, not
* <code>null</code>.
*/
public String getRunnerExecutablePath(String runnerId) {
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return languagePreferences.getString(
LanguagePreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware, runnerId));
}
/**
* Gets the parameters for the runner.
*
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return The parameters for the runner, may be empty, not <code>null</code>.
*/
public String getRunnerCommandLine(String runnerId) {
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return languagePreferences.getString(
LanguagePreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId));
}
/**
* Gets the wait for completion indicator for the runner.
*
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return <code>true</code>if waiting for completion is requested,
* <code>false</code> otherwise.
*
* @since 1.6.1
*/
public boolean isRunnerWaitForCompletion(String runnerId) {
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return languagePreferences.getBoolean(
LanguagePreferencesConstants.getCompilerRunnerWaitForCompletionName(compilerId, hardware, runnerId));
}
}

View File

@ -0,0 +1,298 @@
/**
R * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
*
* This file is part of WUDSN IDE.
*
* WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.lng.preferences;
import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.compiler.CompilerDefinition;
/**
* Constants for preferences.
*
* @author Peter Dell
*/
public final class LanguageHardwareCompilerDefinitionPreferencesConstants {
/**
* Gets preference key name prefix for a given hardware and compiler.
*
* @param language The language, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
*
*
* @return The preference key name prefix without trailing dot, not empty and
* not <code>null</code>.
*/
private static String getLanguageHardwareCompilerDefinitionPrefix(Language language, Hardware hardware,
CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return LanguagePreferencesConstants.getLanguagePreferencesKey(language,
"hardware." + hardware.name().toLowerCase() + ".compiler." + compilerDefinition.getId());
}
/**
* Gets preference key name for the compiler output file extension.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler output file extension, not
* empty and not <code>null</code>.
*/
static String getCompilerOutputFileExtensionName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition)
+ ".output.file.extension"; //$NON-NLS-1$
}
/**
* Gets preference key name for the compiler output folder mode.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler output folder mode, not
* empty and not <code>null</code>.
*/
static String getCompilerOutputFolderModeName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition)
+ ".output.folder.mode"; //$NON-NLS-1$
}
/**
* Gets preference key name for the compiler output folder path.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler output folder path, not
* empty and not <code>null</code>.
*/
static String getCompilerOutputFolderPathName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition)
+ ".output.folder.path"; //$NON-NLS-1$
}
/**
* Gets preference key name for the compiler parameters.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler parameters, not empty and
* not <code>null</code>.
*/
static String getCompilerParametersName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition)
+ ".default.parameters"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner command line.
*
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner command line, not empty and
* not <code>null</code>.
*/
static String getCompilerRunnerCommandLineName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition, String runnerId) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition) + ".runner." //$NON-NLS-1$
+ runnerId + ".parameters";
}
/**
* Gets preference key name for the runner executable path.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner executable path, not empty and
* not <code>null</code>.
*/
static String getCompilerRunnerExecutablePathName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition, String runnerId) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition) + ".runner." //$NON-NLS-1$
+ runnerId + ".executable.path";
}
/**
* Gets preference key name for the runner to run the output file.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the for the runner to run the output
* file, not empty and not <code>null</code>.
*/
static String getCompilerRunnerIdName(Language language, Hardware hardware, CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition) + ".runner.id"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner wait for completion flag.
*
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner command line, not empty and
* not <code>null</code>.
* @since 1.6.1
*/
static String getCompilerRunnerWaitForCompletionName(Language language, Hardware hardware,
CompilerDefinition compilerDefinition, String runnerId) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition) + ".runner." //$NON-NLS-1$
+ runnerId + ".waitForCompletion";
}
/**
* Gets preference key name for the compiler Target visibility.
*
* @param language The language, not <code>null</code>.
* @param compilerDefinition The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler Target, not empty and not
* <code>null</code>.
*/
public static String getCompilerTargetName(Language language, Hardware hardware, CompilerDefinition compilerDefinition) {
if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getLanguageHardwareCompilerDefinitionPrefix(language, hardware, compilerDefinition) + ".target"; //$NON-NLS-1$
}
}

View File

@ -19,12 +19,19 @@
package com.wudsn.ide.lng.preferences; package com.wudsn.ide.lng.preferences;
import java.io.File;
import org.eclipse.jface.text.TextAttribute; import org.eclipse.jface.text.TextAttribute;
import com.wudsn.ide.base.common.AbstractIDEPlugin; import com.wudsn.ide.base.common.AbstractIDEPlugin;
import com.wudsn.ide.base.common.StringUtility;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.LanguagePlugin;
import com.wudsn.ide.lng.compiler.CompilerDefinition; import com.wudsn.ide.lng.compiler.CompilerDefinition;
import com.wudsn.ide.lng.compiler.CompilerPaths;
import com.wudsn.ide.lng.compiler.CompilerPaths.CompilerPath;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase; import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase;
import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode; import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode;
@ -72,7 +79,7 @@ public final class LanguagePreferences {
* See {@link LanguageContentAssistProcessorDefaultCase}. * See {@link LanguageContentAssistProcessorDefaultCase}.
*/ */
public String getEditorContentAssistProcessorDefaultCase() { public String getEditorContentAssistProcessorDefaultCase() {
return getString(LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE); return getString(EditorConstants.getEditorContentProcessorDefaultCaseKey(language));
} }
/** /**
@ -83,91 +90,134 @@ public final class LanguagePreferences {
* @since 1.6.1 * @since 1.6.1
*/ */
public String getEditorCompileCommandPositioningMode() { public String getEditorCompileCommandPositioningMode() {
return getString(LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE); return getString(EditorConstants.getEditorCompileCommandPositioningModeKey(language));
}
/**
* Gets the executable path for the compiler.
*
* @param compilerDefinition The compiler definition, not <code>null</code>.
*
* @return The executable path for the runner, may be empty, not
* <code>null</code>.
*/
public String getCompilerExecutablePath(CompilerDefinition compilerDefinition) {
if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
}
return getString(LanguagePreferencesConstants.getCompilerExecutablePathKey(language, compilerDefinition));
}
/**
* Gets the executable path for the compiler or the default from the
* {@linkplain CompilerPaths}.
*
* @param compilerDefinition The compiler definition, not <code>null</code>.
*
* @return The executable path for the runner, may be empty, not
* <code>null</code>.
*/
public String getCompilerExecutablePathOrDefault(CompilerDefinition compilerDefinition) {
String compilerExecutablePath = getCompilerExecutablePath(compilerDefinition);
CompilerPaths compilerPaths = LanguagePlugin.getInstance().getCompilerPaths();
if (StringUtility.isEmpty(compilerExecutablePath)) {
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(language, compilerDefinition);
if (compilerPath != null) {
File compilerFile = compilerPath.getAbsoluteFile();
if (compilerFile != null) {
if (compilerFile.exists() && compilerFile.isFile() && compilerFile.canExecute()) {
compilerExecutablePath = compilerFile.getAbsolutePath();
}
}
}
}
return compilerExecutablePath;
} }
/** /**
* Gets the preferences for a compiler. * Gets the preferences for a compiler.
* *
* @param compilerDefinition The compiler definition, not empty and not
* <code>null</code>.
* @param hardware The preferences or <code>null</code> if the * @param hardware The preferences or <code>null</code> if the
* compiler is not active for that hardware. * compiler is not active for that hardware.
* @param compilerDefinition The compiler definition, not empty and not
* <code>null</code>.
* *
* @return The compiler preferences, not <code>null</code>. * @return The compiler preferences, not <code>null</code>.
*/ */
public CompilerPreferences getCompilerPreferences(CompilerDefinition compilerDefinition, Hardware hardware) { public LanguageHardwareCompilerDefinitionPreferences getLanguageHardwareCompilerDefinitionPreferences(
Hardware hardware, CompilerDefinition compilerDefinition) {
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (compilerDefinition == null) { if (compilerDefinition == null) {
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null."); throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
} }
if (hardware == null) { return new LanguageHardwareCompilerDefinitionPreferences(this, hardware, compilerDefinition);
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return new CompilerPreferences(this, compilerDefinition.getId(), hardware);
} }
/** /**
* Gets the preferences for the language of these preferences and a suffix. * Create the preferences key for a property of a given language.
* *
* @param preferencesKeySuffix The key suffix, not empty and not <code>null</code>. * @param language The language, not <code>null</code>
* @return The language preferences key, not empty and not <code>null</code>. * @param preferencesKeySuffix The suffix as defined by the constants of this
* class, not empty, not <code>null</code>
* @return
*/ */
public String getPreferencesKey(String preferencesKeySuffix) { public static String getLanguagePreferencesKey(Language language, String preferencesKeySuffix) {
return LanguagePreferencesConstants.getPreferencesKey(language, preferencesKeySuffix); return language.name().toLowerCase() + "." + preferencesKeySuffix;
} }
/** /**
* Gets the current value of the boolean preference with the given name. Returns * Gets the current value of the boolean preference with the given name. Returns
* the default value <code>false</code> if there is no preference with the given * the default value <code>false</code> if there is no preference with the given
* name, or if the current value cannot be treated as a boolean. * name, or if the current value cannot be treated as a boolean.
* *
* @param preferencesKeySuffix The he preferences key suffix of the preference, * @param preferencesKey The key of the preference, not empty and not
* not <code>null</code>. * <code>null</code>.
* @return The preference value. * @return The preference value.
*/ */
boolean getBoolean(String preferencesKeySuffix) { boolean getBoolean(String preferencesKey) {
if (preferencesKeySuffix == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'preferencesKeySuffix' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
return languagesPreferences return languagesPreferences.getBoolean(preferencesKey);
.getBoolean(getPreferencesKey(preferencesKeySuffix));
} }
/** /**
* Gets the current value of the string-valued preference with the given name. * Gets the current value of the string-valued preference with the given name.
* Returns the default-default value (the empty string <code>""</code> ) if * Returns the default-default value (the empty string <code>""</code> ) if
* there is no preference with the given name, or if the current value cannot be * there is no preference with the given name, or if the current value cannot be
* treated as a string. * treated as a string.
* *
* @param preferencesKeySuffix The preferences key suffix of the preference, not * @param preferencesKey The key of the preference, not empty and not
* <code>null</code>. * <code>null</code>.
*
* @return The preference value, may be empty, not <code>null</code>. * @return The preference value, may be empty, not <code>null</code>.
*/ */
String getString(String preferencesKeySuffix) { String getString(String preferencesKey) {
if (preferencesKeySuffix == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'preferencesKeySuffix' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
return languagesPreferences return languagesPreferences.getString(preferencesKey);
.getString(getPreferencesKey(preferencesKeySuffix));
} }
/** /**
* Gets the text attribute for a token type. * Gets the text attribute for a token type.
* *
* @param textAttributeName The suffix of the preferences for the token type, * @param preferencesKey The key of the preference, not empty and not
* see {@link LanguagePreferencesConstants}. * <code>null</code>.
* *
* @return The text attribute, not <code>null</code>. * @return The text attribute, not <code>null</code>.
*/ */
public TextAttribute getEditorTextAttribute(String textAttributeName) { public TextAttribute getTextAttribute(String preferencesKey) {
if (textAttributeName == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
return languagesPreferences return languagesPreferences.getEditorTextAttribute(preferencesKey);
.getEditorTextAttribute(getPreferencesKey(textAttributeName));
} }

View File

@ -1,464 +1,303 @@
/** /**
R * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a> R * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
* *
* This file is part of WUDSN IDE. * This file is part of WUDSN IDE.
* *
* WUDSN IDE is free software: you can redistribute it and/or modify * WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* WUDSN IDE is distributed in the hope that it will be useful, * WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>. * along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.wudsn.ide.lng.preferences; package com.wudsn.ide.lng.preferences;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Texts;
import com.wudsn.ide.lng.Texts; import com.wudsn.ide.lng.compiler.CompilerDefinition;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
/**
* Constants for preferences. The string constants are preferences key suffix /**
* that are not used directly but prefixes with the language. * Constants for preferences.
* *
* @author Peter Dell * @author Peter Dell
*/ */
public final class LanguagePreferencesConstants { public final class LanguagePreferencesConstants {
/** public static final class EditorConstants {
* Creation is private. /**
*/ * Preference key for comment text style.
private LanguagePreferencesConstants() { */
} public static final String EDITOR_TEXT_ATTRIBUTE_COMMENT = "editor.text.attribute.comment"; //$NON-NLS-1$
/** /**
* Preference key for comment text style. * Preferences key for string text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_COMMENT = "editor.text.attribute.comment"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_STRING = "editor.text.attribute.string"; //$NON-NLS-1$
/** /**
* Preferences key for string text style. * Preferences key for number text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_STRING = "editor.text.attribute.string"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_NUMBER = "editor.text.attribute.number"; //$NON-NLS-1$
/** /**
* Preferences key for number text style. * Preference key for directive text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_NUMBER = "editor.text.attribute.number"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_DIRECTVE = "editor.text.attribute.directive"; //$NON-NLS-1$
/** /**
* Preference key for directive text style. * Preference key for legal opcode text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_DIRECTVE = "editor.text.attribute.directive"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL = "editor.text.attribute.opcode.legal"; //$NON-NLS-1$
/** /**
* Preference key for legal opcode text style. * Preference key for illegal opcode text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL = "editor.text.attribute.opcode.legal"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL = "editor.text.attribute.opcode.illegal"; //$NON-NLS-1$
/** /**
* Preference key for illegal opcode text style. * Preference key for pseudo opcode text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL = "editor.text.attribute.opcode.illegal"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO = "editor.text.attribute.opcode.pseudo"; //$NON-NLS-1$
/** /**
* Preference key for pseudo opcode text style. * Preference key for equate identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO = "editor.text.attribute.opcode.pseudo"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE = "editor.text.attribute.identifier.equate"; //$NON-NLS-1$
/** /**
* Preference key for equate identifier text style. * Preference key for label identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE = "editor.text.attribute.identifier.equate"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL = "editor.text.attribute.identifier.label"; //$NON-NLS-1$
/** /**
* Preference key for label identifier text style. * Preference key for enum identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL = "editor.text.attribute.identifier.label"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION = "editor.text.attribute.identifier.enum"; //$NON-NLS-1$
/** /**
* Preference key for enum identifier text style. * Preference key for structure identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION = "editor.text.attribute.identifier.enum"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION = "editor.text.attribute.identifier.structure"; //$NON-NLS-1$
/** /**
* Preference key for structure identifier text style. * Preference key for local identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION = "editor.text.attribute.identifier.structure"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION = "editor.text.attribute.identifier.local"; //$NON-NLS-1$
/** /**
* Preference key for local identifier text style. * Preference key for macro identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION = "editor.text.attribute.identifier.local"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION = "editor.text.attribute.identifier.macro"; //$NON-NLS-1$
/** /**
* Preference key for macro identifier text style. * Preference key for default case for content assist.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION = "editor.text.attribute.identifier.macro"; //$NON-NLS-1$ static final String EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE = "editor.content.assist.processor.default.case"; //$NON-NLS-1$
/** /**
* Preference key for procedure identifier text style. * Preference key for procedure identifier text style.
*/ */
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION = "editor.text.attribute.identifier.procedure"; //$NON-NLS-1$ public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION = "editor.text.attribute.identifier.procedure"; //$NON-NLS-1$
/**
* Preference key for default case for content assist. /**
*/ * Preference key for positioning for for compiling.
static final String EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE = "editor.content.assist.processor.default.case"; //$NON-NLS-1$ *
* @since 1.6.1
/** */
* Preference key for positioning for for compiling. static final String EDITOR_COMPILE_COMMAND_POSITIONING_MODE = "editor.compile.command.positioning.mode"; //$NON-NLS-1$
*
* @since 1.6.1 /**
*/ * Gets preference key name for a editor attribute.
static final String EDITOR_COMPILE_COMMAND_POSITIONING_MODE = "editor.compile.command.positioning.mode"; //$NON-NLS-1$ *
* @param language The language <code>null</code>.
/** *
* Create the preferences key for a property of a given language. * @return The preference key name for the compiler executable path, not empty
* * and not <code>null</code>.
* @param language The language, not <code>null</code> */
* @param preferencesKeySuffix The suffix as defined by the constants of this public static String getEditorAttributeKey(Language language, String textAttributeName) {
* class, not empty, not <code>null</code> if (language == null) {
* @return throw new IllegalArgumentException("Parameter 'language' must not be null.");
*/ }
public static String getPreferencesKey(Language language, String preferencesKeySuffix) { String preferencesKey = getLanguagePreferencesKey(language, textAttributeName);
return language.name().toLowerCase() + "." + preferencesKeySuffix; return preferencesKey;
} }
/** static String getEditorContentProcessorDefaultCaseKey(Language language) {
* Get list of all preferences keys that depend on the global JFact text font if (language == null) {
* setting. throw new IllegalArgumentException("Parameter 'language' must not be null.");
*/ }
public static List<TextAttributeDefinition> getTextAttributeDefinitions(Language language) {
if (language == null) { return getEditorAttributeKey(language, EditorConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE);
throw new IllegalArgumentException("Parameter 'language' must not be null."); }
}
static String getEditorCompileCommandPositioningModeKey(Language language) {
List<TextAttributeDefinition> result = new ArrayList<TextAttributeDefinition>(); if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null.");
// Comments and literals }
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_COMMENT),
Texts.PREFERENCES_TEXT_ATTRIBUTE_COMMENT_NAME)); return getEditorAttributeKey(language, EditorConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE);
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_NUMBER), }
Texts.PREFERENCES_TEXT_ATTRIBUTE_NUMBER_NAME));
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_STRING), /**
Texts.PREFERENCES_TEXT_ATTRIBUTE_STRING_NAME)); * Gets the list of all preferences keys that depend on the global JFact text
* font setting.
switch (language) { *
case ASM: { * @param language The language, not <code>null</code>.
*/
// Built-in public static List<TextAttributeDefinition> getTextAttributeDefinitions(Language language) {
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE), if (language == null) {
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE)); throw new IllegalArgumentException("Parameter 'language' must not be null.");
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL), }
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_ILLEGAL_NAME));
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL), List<TextAttributeDefinition> result = new ArrayList<TextAttributeDefinition>();
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_LEGAL_NAME));
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO), // Comments and literals
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_PSEUDO_NAME)); result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_COMMENT),
Texts.PREFERENCES_TEXT_ATTRIBUTE_COMMENT_NAME));
// Identifiers result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_NUMBER),
result.add(new TextAttributeDefinition( Texts.PREFERENCES_TEXT_ATTRIBUTE_NUMBER_NAME));
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION), result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_STRING),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_STRING_NAME));
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE)); switch (language) {
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL), case ASM: {
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LABEL));
result.add(new TextAttributeDefinition( // Built-in
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION), result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
result.add(new TextAttributeDefinition( result.add(new TextAttributeDefinition(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION), getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_ILLEGAL_NAME));
result.add(new TextAttributeDefinition( result.add(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION), new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_LEGAL_NAME));
result.add(new TextAttributeDefinition( result.add(new TextAttributeDefinition(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION), getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_PSEUDO_NAME));
break;
// Identifiers
} result.add(new TextAttributeDefinition(
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
case PAS: { Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
result.add(new TextAttributeDefinition(
// Built-in getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE),
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE), Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE));
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE)); result.add(new TextAttributeDefinition(
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL),
// Identifiers Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LABEL));
result.add(new TextAttributeDefinition( result.add(new TextAttributeDefinition(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION), getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION));
result.add(new TextAttributeDefinition( result.add(new TextAttributeDefinition(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION), getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION));
result.add(new TextAttributeDefinition( result.add(new TextAttributeDefinition(
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION), getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION)); Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
break; result.add(new TextAttributeDefinition(
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
} Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
default: break;
throw new IllegalArgumentException("Unsupported language " + language + ".");
} }
return result; case PAS: {
}
// Built-in
/** result.add(
* Determines if preference key name represents a setting for compiler targets new TextAttributeDefinition(getLanguagePreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
* visibility. Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
*
* @param name The name of the preferences key, not <code>null</code>. // Identifiers
* @return <code>true</code> if preference key name represents a setting for result.add(new TextAttributeDefinition(
* compiler opcodes visibility, <code>false</code> otherwise. getLanguagePreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
*/ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
public static boolean isCompilerTargetName(String name) { result.add(new TextAttributeDefinition(
if (name == null) { getLanguagePreferencesKey(language,
throw new IllegalArgumentException("Parameter 'name' must not be null."); EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
} Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
boolean result = name.startsWith("compiler.") && name.endsWith(".target"); result.add(new TextAttributeDefinition(
return result; getLanguagePreferencesKey(language,
} EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
/** break;
* Gets preference key name for the compiler executable path. This is the only
* hardware independent compiler setting. }
* default:
* @param compilerId The compiler id, not <code>null</code>. throw new IllegalArgumentException("Unsupported language " + language + ".");
* }
* @return The preference key name for the compiler executable path, not empty
* and not <code>null</code>. return result;
*/ }
static String getCompilerExecutablePathName(String compilerId) { }
if (compilerId == null) { /**
throw new IllegalArgumentException("Parameter 'compilerId' must not be null."); * Creation is private.
} */
return "compiler." + compilerId + ".executable.path"; //$NON-NLS-1$ private LanguagePreferencesConstants() {
} }
/** /**
* Gets preference key name for the compiler Target visibility. * Determines if preference key name represents a setting for compiler targets
* * visibility.
* @param compilerId The compiler id, not <code>null</code>. *
* @param hardware The hardware, not <code>null</code>. * @param name The name of the preferences key, not <code>null</code>.
* * @return <code>true</code> if preference key name represents a setting for
* @return The preference key name for the compiler Target, not empty and not * compiler opcodes visibility, <code>false</code> otherwise.
* <code>null</code>. */
*/ public static boolean isCompilerTargetName(Language language, String preferencesKey) {
static String getCompilerTargetName(String compilerId, Hardware hardware) { if (language == null) {
if (compilerId == null) { throw new IllegalArgumentException("Parameter 'language' must not be null.");
throw new IllegalArgumentException("Parameter 'compilerId' must not be null."); }
} if (preferencesKey == null) {
if (hardware == null) { throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
throw new IllegalArgumentException("Parameter 'hardware' must not be null."); }
} var prefix = getLanguagePreferencesKey(language, "compiler.");
return getCompilerHardwarePrefix(compilerId, hardware) + ".target"; //$NON-NLS-1$ boolean result = preferencesKey.startsWith(prefix) && preferencesKey.endsWith(".target");
} return result;
}
/**
* Gets preference key name for the compiler parameters. /**
* * Create the preferences key for a property of a given language.
* @param compilerId The compiler id, not <code>null</code>. *
* @param hardware The hardware, not <code>null</code>. * @param language The language, not <code>null</code>
* * @param preferencesKeySuffix The suffix as defined by the constants of this
* @return The preference key name for the compiler parameters, not empty and * class, not empty, not <code>null</code>
* not <code>null</code>. * @return
*/ */
static String getCompilerParametersName(String compilerId, Hardware hardware) { static String getLanguagePreferencesKey(Language language, String preferencesKeySuffix) {
if (compilerId == null) { return language.name().toLowerCase() + "." + preferencesKeySuffix;
throw new IllegalArgumentException("Parameter 'compilerId' must not be null."); }
}
if (hardware == null) { /**
throw new IllegalArgumentException("Parameter 'hardware' must not be null."); * Gets preference key name for the compiler executable path. This is the only
} * hardware independent compiler setting.
return getCompilerHardwarePrefix(compilerId, hardware) + ".default.parameters"; //$NON-NLS-1$ *
} * @param The language, not <code>null</code>
* @param compilerDefinition The compiler definition, not <code>null</code>.
/** *
* Gets preference key name for the compiler output folder mode. * @return The preference key name for the compiler executable path, not empty
* * and not <code>null</code>.
* @param compilerId The compiler id, not <code>null</code>. */
* @param hardware The hardware, not <code>null</code>. static String getCompilerExecutablePathKey(Language language, CompilerDefinition compilerDefinition) {
* if (language == null) {
* @return The preference key name for the compiler output folder mode, not throw new IllegalArgumentException("Parameter 'language' must not be null.");
* empty and not <code>null</code>. }
*/ if (compilerDefinition == null) {
static String getCompilerOutputFolderModeName(String compilerId, Hardware hardware) { throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
if (compilerId == null) { }
throw new IllegalArgumentException("Parameter 'compilerId' must not be null."); return getLanguagePreferencesKey(language, "compiler." + compilerDefinition.getId() + ".executable.path"); //$NON-NLS-1$
} }
if (hardware == null) { }
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".output.folder.mode"; //$NON-NLS-1$
}
/**
* Gets preference key name for the compiler output folder path.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler output folder path, not
* empty and not <code>null</code>.
*/
static String getCompilerOutputFolderPathName(String compilerId, Hardware hardware) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".output.folder.path"; //$NON-NLS-1$
}
/**
* Gets preference key name for the compiler output file extension.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the compiler output file extension, not
* empty and not <code>null</code>.
*/
static String getCompilerOutputFileExtensionName(String compilerId, Hardware hardware) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".output.file.extension"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner to run the output file.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
*
* @return The preference key name for the for the runner to run the output
* file, not empty and not <code>null</code>.
*/
static String getCompilerRunnerIdName(String compilerId, Hardware hardware) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".runner.id"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner executable path.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner executable path, not empty and
* not <code>null</code>.
*/
static String getCompilerRunnerExecutablePathName(String compilerId, Hardware hardware, String runnerId) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".runner." + runnerId + ".executable.path"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner command line.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner command line, not empty and
* not <code>null</code>.
*/
static String getCompilerRunnerCommandLineName(String compilerId, Hardware hardware, String runnerId) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".runner." + runnerId + ".parameters"; //$NON-NLS-1$
}
/**
* Gets preference key name for the runner wait for completion flag.
*
* @param compilerId The compiler id, not <code>null</code>.
* @param hardware The hardware, not <code>null</code>.
* @param runnerId The runner id, not <code>null</code>.
*
* @return The preference key name for the runner command line, not empty and
* not <code>null</code>.
* @since 1.6.1
*/
static String getCompilerRunnerWaitForCompletionName(String compilerId, Hardware hardware, String runnerId) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
if (runnerId == null) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be null.");
}
return getCompilerHardwarePrefix(compilerId, hardware) + ".runner." + runnerId + ".waitForCompletion"; //$NON-NLS-1$
}
/**
* Gets preference key name prefix for a given hardware and compiler.
*
* @param hardware The hardware, not <code>null</code>.
* @param compilerId The compiler id, not <code>null</code>.
*
*
* @return The preference key name prefix without trailing dot, not empty and
* not <code>null</code>.
*/
private static String getCompilerHardwarePrefix(String compilerId, Hardware hardware) {
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
if (hardware == null) {
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
}
return "compiler." + compilerId + "." + hardware.name().toLowerCase();
}
}

View File

@ -19,8 +19,6 @@
package com.wudsn.ide.lng.preferences; package com.wudsn.ide.lng.preferences;
import java.util.List;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.TextAttribute; import org.eclipse.jface.text.TextAttribute;
@ -32,11 +30,10 @@ import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.base.hardware.HardwareUtility; import com.wudsn.ide.base.hardware.HardwareUtility;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.LanguagePlugin; import com.wudsn.ide.lng.LanguagePlugin;
import com.wudsn.ide.lng.compiler.CompilerDefinition;
import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode; import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode;
import com.wudsn.ide.lng.compiler.CompilerRegistry;
import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase; import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase;
import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode; import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
import com.wudsn.ide.lng.runner.RunnerId; import com.wudsn.ide.lng.runner.RunnerId;
/** /**
@ -56,15 +53,18 @@ public final class LanguagePreferencesInitializer extends AbstractPreferenceInit
} }
private void setDefault(Language language, String key, String value) { private void setDefault(String key, String value) {
store.setDefault(language.name().toLowerCase() + "." + key, value); store.setDefault(key, value);
} }
private void setDefault(Language language, String key, int r, int g, int b, int style) { private void setLanguageTextAttributeDefault(Language language, String textAttributeName, int r, int g, int b,
int style) {
// Editor. // Editor.
Display display = Display.getCurrent(); var display = Display.getCurrent();
TextAttribute textAttribute = new TextAttribute(new Color(display, r, g, b), null, style); var textAttribute = new TextAttribute(new Color(display, r, g, b), null, style);
store.setDefault(language.name().toLowerCase() + "." + key, TextAttributeConverter.toString(textAttribute)); var preferencesKey = LanguagePreferencesConstants.EditorConstants.getEditorAttributeKey(language,
textAttributeName);
setDefault(preferencesKey, TextAttributeConverter.toString(textAttribute));
} }
@Override @Override
@ -82,56 +82,62 @@ public final class LanguagePreferencesInitializer extends AbstractPreferenceInit
throw new IllegalArgumentException("Parameter 'language' must not be null."); throw new IllegalArgumentException("Parameter 'language' must not be null.");
} }
initializeEditorPreferences(language); initializeEditorPreferences(language);
initializeCompilerPreferences(language); initializeHardwareCompilerDefinitionPreferences(language);
} }
private void initializeEditorPreferences(Language language) { private void initializeEditorPreferences(Language language) {
if (language == null) { if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null."); throw new IllegalArgumentException("Parameter 'language' must not be null.");
} }
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT, 0, 128, 0, SWT.ITALIC); setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT, 0, 128, 0, SWT.ITALIC);
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE, 128, 64, 0, SWT.BOLD); setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE, 128, 64, 0, SWT.BOLD);
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER, 0, 0, 255, SWT.BOLD); setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER, 0, 0, 255, SWT.BOLD);
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL, 0, 0, 128, SWT.BOLD); setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL, 0, 0, 128,
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL, 255, 32, 32, SWT.BOLD); SWT.BOLD);
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO, 32, 128, 32, SWT.BOLD); setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL, 255, 32, 32,
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING, 0, 0, 255, SWT.NORMAL); SWT.BOLD);
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO, 32, 128, 32,
SWT.BOLD);
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_STRING, 0, 0, 255, SWT.NORMAL);
// Content assist. // Content assist.
setDefault(language, LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE, var preferencesKey = EditorConstants.getEditorContentProcessorDefaultCaseKey(language);
LanguageContentAssistProcessorDefaultCase.LOWER_CASE); setDefault(preferencesKey, LanguageContentAssistProcessorDefaultCase.LOWER_CASE);
// Compiling. // Compiling.
setDefault(language, LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE, preferencesKey = EditorConstants.getEditorCompileCommandPositioningModeKey(language);
LanguageEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING); setDefault(preferencesKey, LanguageEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING);
} }
private void initializeCompilerPreferences(Language language) { private void initializeHardwareCompilerDefinitionPreferences(Language language) {
if (language == null) { if (language == null) {
throw new IllegalArgumentException("Parameter 'language' must not be null."); throw new IllegalArgumentException("Parameter 'language' must not be null.");
} }
LanguagePlugin languagePlugin = LanguagePlugin.getInstance(); var languagePlugin = LanguagePlugin.getInstance();
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry(); var compilerRegistry = languagePlugin.getCompilerRegistry();
List<CompilerDefinition> compilerDefinitions = compilerRegistry.getCompilerDefinitions(language); var compilerDefinitions = compilerRegistry.getCompilerDefinitions(language);
for (CompilerDefinition compilerDefinition : compilerDefinitions) {
String compilerId = compilerDefinition.getId();
String name;
for (Hardware hardware : Hardware.values()) { for (Hardware hardware : Hardware.values()) {
if (hardware.equals(Hardware.GENERIC)) { if (hardware.equals(Hardware.GENERIC)) {
continue; continue;
} }
setDefault(language, LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware), for (var compilerDefinition : compilerDefinitions) {
compilerDefinition.getSupportedTargets().get(0).toString());
name = LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware); setDefault(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerTargetName(language,
setDefault(language, name, compilerDefinition.getDefaultParameters()); hardware, compilerDefinition), compilerDefinition.getSupportedTargets().get(0).toString());
name = LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware);
setDefault(language, name, CompilerOutputFolderMode.TEMP_FOLDER); var preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
name = LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware); .getCompilerParametersName(language, hardware, compilerDefinition);
setDefault(language, name, HardwareUtility.getDefaultFileExtension(hardware)); setDefault(preferencesKey, compilerDefinition.getDefaultParameters());
name = LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware); preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
setDefault(language, name, RunnerId.DEFAULT_APPLICATION); .getCompilerOutputFolderModeName(language, hardware, compilerDefinition);
setDefault(preferencesKey, CompilerOutputFolderMode.TEMP_FOLDER);
preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
.getCompilerOutputFileExtensionName(language, hardware, compilerDefinition);
setDefault(preferencesKey, HardwareUtility.getDefaultFileExtension(hardware));
preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
.getCompilerRunnerIdName(language, hardware, compilerDefinition);
setDefault(preferencesKey, RunnerId.DEFAULT_APPLICATION);
} }
} }

View File

@ -69,6 +69,7 @@ import com.wudsn.ide.lng.compiler.CompilerRegistry;
import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase; import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase;
import com.wudsn.ide.lng.editor.LanguageEditor; import com.wudsn.ide.lng.editor.LanguageEditor;
import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode; import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode;
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
/** /**
* Visual editor page for the language preferences. * Visual editor page for the language preferences.
@ -358,8 +359,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
if (textAttributeListItems != null) { if (textAttributeListItems != null) {
throw new IllegalStateException("Attribute 'textAttributeListItems' must be null."); throw new IllegalStateException("Attribute 'textAttributeListItems' must be null.");
} }
List<TextAttributeDefinition> textAttributeDefinitions = LanguagePreferencesConstants List<TextAttributeDefinition> textAttributeDefinitions = EditorConstants.getTextAttributeDefinitions(language);
.getTextAttributeDefinitions(language);
textAttributeListItems = new ArrayList<TextAttributeListItem>(textAttributeDefinitions.size()); textAttributeListItems = new ArrayList<TextAttributeListItem>(textAttributeDefinitions.size());
for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) { for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) {
@ -394,7 +394,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
}; };
FieldEditor choiceFieldEditor = new RadioGroupFieldEditor( FieldEditor choiceFieldEditor = new RadioGroupFieldEditor(
LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE, EditorConstants.getEditorContentProcessorDefaultCaseKey(language),
Texts.PREFERENCES_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE_LABEL, 2, labelsAndValues, space); Texts.PREFERENCES_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE_LABEL, 2, labelsAndValues, space);
addField(choiceFieldEditor); addField(choiceFieldEditor);
@ -410,7 +410,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
}; };
choiceFieldEditor = new RadioGroupFieldEditor( choiceFieldEditor = new RadioGroupFieldEditor(
LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE, EditorConstants.getEditorCompileCommandPositioningModeKey(language),
Texts.PREFERENCES_COMPILE_COMMAND_POSITIONING_MODE_LABEL, 2, labelsAndValues, space); Texts.PREFERENCES_COMPILE_COMMAND_POSITIONING_MODE_LABEL, 2, labelsAndValues, space);
addField(choiceFieldEditor); addField(choiceFieldEditor);
@ -432,21 +432,16 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
TabItem tabItem = new TabItem(tabFolder, SWT.NONE); TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
tabItem.setText(compilerDefinition.getName()); tabItem.setText(compilerDefinition.getName());
Composite tabContent; var tabContent = SWTFactory.createComposite(tabFolder, 1, 1, GridData.FILL_HORIZONTAL);
tabContent = SWTFactory.createComposite(tabFolder, 1, 1, GridData.FILL_HORIZONTAL);
tabItem.setControl(tabContent); tabItem.setControl(tabContent);
Composite composite; var name = LanguagePreferencesConstants.getCompilerExecutablePathKey(language, compilerDefinition);
String name;
name = LanguagePreferencesConstants.getPreferencesKey(language,
LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId));
// Field: executablePath // Field: executablePath
composite = SWTFactory.createComposite(tabContent, 4, 2, GridData.FILL_HORIZONTAL); var composite = SWTFactory.createComposite(tabContent, 4, 2, GridData.FILL_HORIZONTAL);
FileFieldDownloadEditor fileFieldEditor = new FileFieldDownloadEditor(name, FileFieldDownloadEditor fileFieldEditor = new FileFieldDownloadEditor(name,
Texts.PREFERENCES_COMPILER_EXECUTABLE_PATH_LABEL, composite); Texts.PREFERENCES_COMPILER_EXECUTABLE_PATH_LABEL, composite);
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(language, compilerId); CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(language, compilerDefinition);
if (compilerPath != null) { if (compilerPath != null) {
File file = compilerPath.getAbsoluteFile(); File file = compilerPath.getAbsoluteFile();
if (file != null) { if (file != null) {

View File

@ -24,6 +24,7 @@ import org.eclipse.jface.text.TextAttribute;
import com.wudsn.ide.base.common.AbstractIDEPlugin; import com.wudsn.ide.base.common.AbstractIDEPlugin;
import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.Language;
import com.wudsn.ide.lng.LanguagePlugin;
/** /**
* Facade class for typed access to the plugin preferences. * Facade class for typed access to the plugin preferences.
@ -77,7 +78,9 @@ public final class LanguagesPreferences {
if (preferencesKey == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
return preferenceStore.getBoolean(preferencesKey); var result = preferenceStore.getBoolean(preferencesKey);
log(preferencesKey, result ? "true" : "false");
return result;
} }
/** /**
@ -100,7 +103,7 @@ public final class LanguagesPreferences {
} else { } else {
result = result.trim(); result = result.trim();
} }
log(preferencesKey, result);
return result; return result;
} }
@ -112,12 +115,28 @@ public final class LanguagesPreferences {
* @return The text attribute, not <code>null</code>. * @return The text attribute, not <code>null</code>.
* *
*/ */
public TextAttribute getEditorTextAttribute(String preferencesKey) { TextAttribute getEditorTextAttribute(String preferencesKey) {
if (preferencesKey == null) { if (preferencesKey == null) {
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null."); throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
} }
return TextAttributeConverter.fromString(preferenceStore.getString(preferencesKey)); return TextAttributeConverter.fromString(getString(preferencesKey));
}
/**
* Logs the result of a read access for debugging purposes.
*
* @param preferencesKey The preferences key, not <code>null</code>
* @param result The result, not <code>null</code>.
*/
private void log(String preferencesKey, String result) {
if (true) {
if (preferencesKey.startsWith("editor")) {
LanguagePlugin.getInstance().log("Result of language preferences key '{0}' is '{1}'",
new Object[] { preferencesKey, result });
}
}
} }
} }