mirror of
https://github.com/peterdell/wudsn-ide.git
synced 2024-12-21 03:29:32 +00:00
Refactors preferences naming to language+hardware+editor
This commit is contained in:
parent
e102c2b22d
commit
ee7d657e3a
@ -20,7 +20,7 @@ package com.wudsn.ide.lng.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
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
|
||||
@ -29,7 +29,7 @@ import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
* @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".
|
||||
|
@ -1,12 +1,12 @@
|
||||
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.AssemblerPreferencesApple2CompilersPage.name=Apple II Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name=Atari 2600 Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name=Atari 7800 Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name=Atari 8-bit Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name=C64 Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name=NES Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name=Apple II Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name=Atari 2600 Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name=Atari 7800 Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name=Atari 8-bit Assemblers
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage.name=C64 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.AcmeEditor.name=ACME Editor
|
||||
|
@ -1,12 +1,12 @@
|
||||
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.AssemblerPreferencesApple2CompilersPage.name=Apple II Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name=Atari 2600 Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name=Atari 7800 Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name=Atari 8-bit Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name=C64 Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name=NES Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name=Apple II Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name=Atari 2600 Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name=Atari 7800 Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name=Atari 8-bit Assembler
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage.name=C64 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.AcmeEditor.name=ACME Editor
|
||||
|
@ -15,39 +15,39 @@
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesApple2CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerApple2PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari8PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari2600CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari2600PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtar7800CompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari7800CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerAtari7800PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesC64CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerC64PreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesNESCompilersPage.name">
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerNESPreferencesPage.name">
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="com.wudsn.ide.lng.compilers">
|
||||
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesApple2CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesApple2CompilersPage() {
|
||||
super(Language.ASM, Hardware.APPLE2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerApple2PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerApple2PreferencesPage() {
|
||||
super(Language.ASM, Hardware.APPLE2);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesAtari2600CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesAtari2600CompilersPage() {
|
||||
super(Language.ASM,Hardware.ATARI2600);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerAtari2600PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerAtari2600PreferencesPage() {
|
||||
super(Language.ASM,Hardware.ATARI2600);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesAtari7800CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesAtari7800CompilersPage() {
|
||||
super(Language.ASM, Hardware.ATARI7800);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerAtari7800PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerAtari7800PreferencesPage() {
|
||||
super(Language.ASM, Hardware.ATARI7800);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,42 +1,42 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Atari 8-bit
|
||||
* compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesAtari8CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesAtari8CompilersPage() {
|
||||
super(Language.ASM,Hardware.ATARI8BIT);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding Atari 8-bit
|
||||
* compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerAtari8PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerAtari8PreferencesPage() {
|
||||
super(Language.ASM,Hardware.ATARI8BIT);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding C64 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesC64CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesC64CompilersPage() {
|
||||
super(Language.ASM, Hardware.C64);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding C64 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerC64PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerC64PreferencesPage() {
|
||||
super(Language.ASM, Hardware.C64);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding NES compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerPreferencesNESCompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesNESCompilersPage() {
|
||||
super(Language.ASM, Hardware.NES);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.asm.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences regarding NES compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class AssemblerNESPreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerNESPreferencesPage() {
|
||||
super(Language.ASM, Hardware.NES);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
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.PascalPreferencesApple2CompilersPage.name=Apple II Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Atari 2600 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Atari 7800 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Atari 8-bit Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=C64 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=NES Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Apple II Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Atari 2600 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Atari 7800 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Atari 8-bit Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=C64 Compilers
|
||||
com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=NES Compilers
|
||||
|
||||
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Source File
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
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.PascalPreferencesApple2CompilersPage.name=Kompilator Apple II
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Kompilator Atari 2600
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Kompilator Atari 7800
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Kompilator Atari 8-bit
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=Kompilator C64
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=Kompilator NES
|
||||
com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Kompilator Apple II
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Kompilator Atari 2600
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Kompilator Atari 7800
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Kompilator Atari 8-bit
|
||||
com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=Kompilator C64
|
||||
com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=Kompilator NES
|
||||
|
||||
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Plik \u017Aród\u0142owy Pascala
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
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.PascalPreferencesApple2CompilersPage.name=Apple II Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name=Atari 2600 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name=Atari 7800 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name=Atari 8-bit Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name=C64 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name=NES Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name=Apple II Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name=Atari 2600 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name=Atari 7800 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name=Atari 8-bit Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name=C64 Kompiler
|
||||
com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name=NES Kompiler
|
||||
|
||||
com.wudsn.ide.lng.pas.compiler.PascalSourceFile.name=Pascal Quell-Datei
|
||||
|
||||
|
@ -14,39 +14,39 @@
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesApple2CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalApple2PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari8CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalAtari8PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari2600CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalAtari2600PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtar7800CompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesAtari7800CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalAtari7800PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesC64CompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPag"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalC64PreferencesPage.name">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.pas.preferences.PascalPreferencesPage"
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalPreferencesNESCompilersPage.name">
|
||||
class="com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage"
|
||||
id="com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.pas.preferences.PascalNESPreferencesPage.name">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesApple2CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesApple2CompilersPage() {
|
||||
super(Language.PAS, Hardware.APPLE2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalApple2PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalApple2PreferencesPage() {
|
||||
super(Language.PAS, Hardware.APPLE2);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesAtari2600CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesAtari2600CompilersPage() {
|
||||
super(Language.PAS,Hardware.ATARI2600);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalAtari2600PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalAtari2600PreferencesPage() {
|
||||
super(Language.PAS,Hardware.ATARI2600);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesAtari7800CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesAtari7800CompilersPage() {
|
||||
super(Language.PAS, Hardware.ATARI7800);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Apple 2 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalAtari7800PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalAtari7800PreferencesPage() {
|
||||
super(Language.PAS, Hardware.ATARI7800);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,42 +1,42 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Atari 8-bit
|
||||
* compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesAtari8CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesAtari8CompilersPage() {
|
||||
super(Language.PAS,Hardware.ATARI8BIT);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding Atari 8-bit
|
||||
* compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalAtari8PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalAtari8PreferencesPage() {
|
||||
super(Language.PAS,Hardware.ATARI8BIT);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding C64 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesC64CompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesC64CompilersPage() {
|
||||
super(Language.PAS, Hardware.C64);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding C64 compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalC64PreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalC64PreferencesPage() {
|
||||
super(Language.PAS, Hardware.C64);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +1,41 @@
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesCompilersPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding NES compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalPreferencesNESCompilersPage extends LanguagePreferencesCompilersPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalPreferencesNESCompilersPage() {
|
||||
super(Language.PAS,Hardware.NES);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.pas.preferences;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguageHardwarePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the Pascal preferences regarding NES compilers.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
*/
|
||||
public final class PascalNESPreferencesPage extends LanguageHardwarePreferencesPage {
|
||||
|
||||
/**
|
||||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public PascalNESPreferencesPage() {
|
||||
super(Language.PAS,Hardware.NES);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -48,13 +48,12 @@ import com.wudsn.ide.lng.compiler.CompilerPathsTest;
|
||||
import com.wudsn.ide.lng.compiler.CompilerRegistry;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
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.TextAttributeDefinition;
|
||||
import com.wudsn.ide.lng.runner.RunnerPaths;
|
||||
import com.wudsn.ide.lng.runner.RunnerPathsTest;
|
||||
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.
|
||||
*
|
||||
@ -150,6 +149,7 @@ public final class LanguagePlugin extends AbstractIDEPlugin {
|
||||
logError("Cannot initialize compiler registry", null, ex);
|
||||
throw ex;
|
||||
}
|
||||
compilerPaths.init();
|
||||
compilerConsole = new CompilerConsole();
|
||||
try {
|
||||
runnerRegistry.init();
|
||||
@ -167,7 +167,7 @@ public final class LanguagePlugin extends AbstractIDEPlugin {
|
||||
if (event.getProperty().equals(JFaceResources.TEXT_FONT)
|
||||
|| event.getProperty().equals(BLOCK_SELECTION_MODE_FONT)) {
|
||||
for (Language language : languages) {
|
||||
List<TextAttributeDefinition> textAttributeDefinitions = LanguagePreferencesConstants
|
||||
List<TextAttributeDefinition> textAttributeDefinitions = EditorConstants
|
||||
.getTextAttributeDefinitions(language);
|
||||
Set<String> changedPropertyNames = new TreeSet<String>();
|
||||
for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) {
|
||||
|
@ -27,7 +27,7 @@ import com.wudsn.ide.base.common.FileUtility;
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.lng.LanguageProperties;
|
||||
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
|
||||
@ -116,7 +116,7 @@ public final class CompilerFiles {
|
||||
|
||||
public CompilerFiles(IFile mainSourceIFile, LanguageProperties mainSourceFileLanguageProperties,
|
||||
IFile sourceIFile, LanguageProperties sourceFileLanguageProperties,
|
||||
CompilerPreferences compilerPreferences) {
|
||||
LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences) {
|
||||
|
||||
if (mainSourceIFile == null) {
|
||||
throw new IllegalArgumentException("Parameter 'mainSourceIFile' must not be null.");
|
||||
@ -124,7 +124,7 @@ public final class CompilerFiles {
|
||||
if (sourceIFile == 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.");
|
||||
}
|
||||
this.mainSourceFile = new SourceFile(mainSourceIFile, mainSourceFileLanguageProperties);
|
||||
@ -132,9 +132,9 @@ public final class CompilerFiles {
|
||||
|
||||
// Output folder mode
|
||||
// Can be overridden via annotation property in main source file
|
||||
String localOutputFolderPath = compilerPreferences.getOutputFolderPath();
|
||||
String localOutputFolderMode = compilerPreferences.getOutputFolderMode();
|
||||
String localOutputFileExtension = compilerPreferences.getOutputFileExtension();
|
||||
String localOutputFolderPath = languageHardwareCompilerDefinitionPreferences.getOutputFolderPath();
|
||||
String localOutputFolderMode = languageHardwareCompilerDefinitionPreferences.getOutputFolderMode();
|
||||
String localOutputFileExtension = languageHardwareCompilerDefinitionPreferences.getOutputFileExtension();
|
||||
|
||||
// Properties which override the preferences
|
||||
outputFolderModeProperty = mainSourceFileLanguageProperties.get(LanguageProperties.OUTPUT_FOLDER_MODE);
|
||||
|
@ -43,30 +43,32 @@ public final class CompilerPaths {
|
||||
|
||||
public static final class CompilerPath {
|
||||
public final Language language;
|
||||
public final String compilerId;
|
||||
public final CompilerDefinition compilerDefinition;
|
||||
public final String os;
|
||||
public final String osArch;
|
||||
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.compilerId = compilerId;
|
||||
this.compilerDefinition = compilerDefinition;
|
||||
this.os = os;
|
||||
this.osArch = osArch;
|
||||
this.executablePath = executablePath;
|
||||
|
||||
}
|
||||
|
||||
public static String getKey(Language language, String compilerId, String os, String osArch) {
|
||||
return language.name() + "/" + compilerId + "/" + os + "/" + osArch;
|
||||
public static String getKey(Language language, CompilerDefinition compilerDefinition, String os,
|
||||
String osArch) {
|
||||
return language.name() + "/" + compilerDefinition.getId() + "/" + os + "/" + osArch;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return getKey(language, compilerId, os, osArch);
|
||||
return getKey(language, compilerDefinition, os, osArch);
|
||||
}
|
||||
|
||||
public String getRelativePath() {
|
||||
return language.name() + "/" + compilerId.toUpperCase() + "/" + executablePath;
|
||||
return language.name() + "/" + compilerDefinition.getId().toUpperCase() + "/" + executablePath;
|
||||
}
|
||||
|
||||
public File getAbsoluteFile() {
|
||||
@ -81,6 +83,12 @@ public final class CompilerPaths {
|
||||
* Created by the {@linkplain LanguagePlugin}.
|
||||
*/
|
||||
public CompilerPaths() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the default paths.
|
||||
*/
|
||||
public void init() {
|
||||
compilerPaths = new TreeMap<String, CompilerPath>();
|
||||
// See https://github.com/peterdell/wudsn-ide-tools
|
||||
// TODO: Add MERLIN32
|
||||
@ -116,20 +124,27 @@ public final class CompilerPaths {
|
||||
if (!compilerId.equals(compilerId.toLowerCase())) {
|
||||
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);
|
||||
}
|
||||
|
||||
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 osArch = Platform.getOSArch();
|
||||
String key = CompilerPath.getKey(language, compilerId, os, osArch);
|
||||
String key = CompilerPath.getKey(language, compilerDefinition, os, osArch);
|
||||
CompilerPath compilerPath = compilerPaths.get(key);
|
||||
// Default to 32-bit version if 64-bit version not defined?
|
||||
if (compilerPath == null) {
|
||||
if (osArch.equals(Platform.ARCH_X86_64)) {
|
||||
osArch = Platform.ARCH_X86;
|
||||
key = CompilerPath.getKey(language, compilerId, os, osArch);
|
||||
key = CompilerPath.getKey(language, compilerDefinition, os, osArch);
|
||||
compilerPath = compilerPaths.get(key);
|
||||
}
|
||||
}
|
||||
@ -140,16 +155,16 @@ public final class CompilerPaths {
|
||||
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) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("Parameter 'id' must not be null.");
|
||||
if (compilerId == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
|
||||
}
|
||||
List<CompilerPath> result = new ArrayList<>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public final class CompilerPathsTest {
|
||||
filePath = file.getAbsolutePath();
|
||||
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 + " "
|
||||
+ result);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ public final class CompilerRegistry {
|
||||
*
|
||||
* @return The compiler, not <code>null</code>.
|
||||
*/
|
||||
public Compiler getCompilerByKey(String key) {
|
||||
private Compiler getCompilerByKey(String key) {
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("Parameter 'key' must not be null.");
|
||||
}
|
||||
@ -260,4 +260,17 @@ public final class CompilerRegistry {
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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.CompilerSourcePartitionScanner;
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -154,7 +154,7 @@ public abstract class LanguageEditor extends TextEditor {
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the language.
|
||||
*
|
||||
@ -178,8 +178,8 @@ public abstract class LanguageEditor extends TextEditor {
|
||||
*
|
||||
* @return The compiler preferences, not <code>null</code>.
|
||||
*/
|
||||
public final CompilerPreferences getCompilerPreferences() {
|
||||
return getLanguagePreferences().getCompilerPreferences(getCompilerDefinition(), getHardware());
|
||||
public final LanguageHardwareCompilerDefinitionPreferences getLanguageHardwareCompilerPreferences() {
|
||||
return getLanguagePreferences().getLanguageHardwareCompilerDefinitionPreferences(getHardware(), getCompilerDefinition());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -220,7 +220,7 @@ public abstract class LanguageEditor extends TextEditor {
|
||||
if (compiler == null) {
|
||||
throw new IllegalStateException("Field 'compiler' must not be null.");
|
||||
}
|
||||
target = getCompilerPreferences().getTarget();
|
||||
target = getLanguageHardwareCompilerPreferences().getTarget();
|
||||
result = compiler.createSourceParser();
|
||||
result.init(compiler.getDefinition().getSyntax().getInstructionSet(target));
|
||||
return result;
|
||||
@ -429,13 +429,12 @@ public abstract class LanguageEditor extends TextEditor {
|
||||
} else {
|
||||
newIdentifiers = compilerSourceFile.getIdentifiers();
|
||||
}
|
||||
|
||||
|
||||
LanguageSourceViewerConfiguration asvc;
|
||||
LanguageSourceScanner ais;
|
||||
asvc = (LanguageSourceViewerConfiguration) getSourceViewerConfiguration();
|
||||
ais = asvc.getInstructionScanner();
|
||||
|
||||
|
||||
ais.setIdentifiers(newIdentifiers);
|
||||
profiler.begin("refreshSourceViewer");
|
||||
// refreshSourceViewer(); TODO Required?
|
||||
|
@ -218,7 +218,7 @@ final class LanguageEditorCompileCommand {
|
||||
// Create wrapper for run properties.
|
||||
CompilerDefinition compilerDefinition = languageEditor.getCompilerDefinition();
|
||||
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.
|
||||
long outputFileLastModified = -1;
|
||||
@ -248,21 +248,20 @@ final class LanguageEditorCompileCommand {
|
||||
|
||||
// Get and check path to compiler executable.
|
||||
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage());
|
||||
|
||||
String compilerExecutablePath = languageEditor.getCompilerPreferences().getCompilerExecutablePathOrDefault();
|
||||
String compilerExecutablePath = languageEditor.getLanguagePreferences()
|
||||
.getCompilerExecutablePathOrDefault(compilerDefinition);
|
||||
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
||||
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100,
|
||||
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText);
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100, compilerDefinition.getText(),
|
||||
compilerDefinition.getName(), compilerPreferencesText);
|
||||
return false;
|
||||
}
|
||||
File compilerExecutableFile = new File(compilerExecutablePath);
|
||||
if (!compilerExecutableFile.exists()) {
|
||||
// ERROR: Path to {0} '{1}' executable in the '{2}' preferences points to
|
||||
// non-existing file '{3}'.
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103,
|
||||
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText,
|
||||
compilerExecutablePath);
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103, compilerDefinition.getText(),
|
||||
compilerDefinition.getName(), compilerPreferencesText, compilerExecutablePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -282,8 +281,8 @@ final class LanguageEditorCompileCommand {
|
||||
String compilerParameterArray[] = compilerParameters.split(" ");
|
||||
if (compilerParameterArray.length == 0) {
|
||||
// ERROR: The {0} '{1}' does not specify default parameters.
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101,
|
||||
compilerDefinition.getText(), compilerDefinition.getName());
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101, compilerDefinition.getText(),
|
||||
compilerDefinition.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -323,9 +322,9 @@ final class LanguageEditorCompileCommand {
|
||||
} catch (IOException ex) {
|
||||
// ERROR: Cannot execute {0} process '{1}' in working directory '{2}'. System
|
||||
// error: {3}
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105,
|
||||
compilerDefinition.getText(), compilerProcess.getCommandArrayString(),
|
||||
compilerProcess.getWorkingDirectory().getPath(), ex.getMessage());
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105, compilerDefinition.getText(),
|
||||
compilerProcess.getCommandArrayString(), compilerProcess.getWorkingDirectory().getPath(),
|
||||
ex.getMessage());
|
||||
}
|
||||
|
||||
// Refresh the output and the symbols file resource.
|
||||
@ -403,8 +402,7 @@ final class LanguageEditorCompileCommand {
|
||||
if (!compilerSuccess && !errorFound) {
|
||||
// ERROR: {0} process ended with return code {1}. Check the error messages and
|
||||
// the console log.
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127,
|
||||
compilerDefinition.getText(),
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127, compilerDefinition.getText(),
|
||||
NumberUtility.getLongValueDecimalString(compilerProcess.getExitValue()));
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.base.hardware.HardwareUtility;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
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.RunnerId;
|
||||
import com.wudsn.ide.lng.runner.RunnerRegistry;
|
||||
@ -110,7 +110,7 @@ public final class LanguageEditorCompileCommandDelegate
|
||||
RunnerRegistry runnerRegistry = languagePlugin.getRunnerRegistry();
|
||||
Hardware hardware = languageEditor.getHardware();
|
||||
List<RunnerDefinition> runnerDefinitions = runnerRegistry.getDefinitions(hardware);
|
||||
CompilerPreferences compilerPreferences = languageEditor.getCompilerPreferences();
|
||||
LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences = languageEditor.getLanguageHardwareCompilerPreferences();
|
||||
|
||||
Menu menu = new Menu(parent);
|
||||
setMenu(menu);
|
||||
@ -123,7 +123,7 @@ public final class LanguageEditorCompileCommandDelegate
|
||||
String runnerName = runnerDefinition.getName();
|
||||
// The system default application does not need an executable path.
|
||||
if (!runnerId.equals(RunnerId.DEFAULT_APPLICATION)) {
|
||||
if (StringUtility.isEmpty(compilerPreferences.getRunnerExecutablePath(runnerId))) {
|
||||
if (StringUtility.isEmpty(languageHardwareCompilerDefinitionPreferences.getRunnerExecutablePath(runnerId))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -131,7 +131,7 @@ public final class LanguageEditorCompileCommandDelegate
|
||||
Action action = new CompileAndRunAction(runnerId);
|
||||
action.setActionDefinitionId(LanguageEditorCompileCommand.COMPILE_AND_RUN_WITH);
|
||||
action.setImageDescriptor(imageDescriptor);
|
||||
if (runnerId.equals(compilerPreferences.getRunnerId())) {
|
||||
if (runnerId.equals(languageHardwareCompilerDefinitionPreferences.getRunnerId())) {
|
||||
runnerName = runnerName + " " + Texts.COMPILER_TOOLBAR_RUN_WITH_DEFAULT_LABEL;
|
||||
}
|
||||
action.setText(runnerName);
|
||||
|
@ -45,8 +45,8 @@ public final class LanguageEditorCompilerHelpCommandHandler extends AbstractHand
|
||||
|
||||
var languageEditor = (LanguageEditor) editor;
|
||||
var compilerDefinition = languageEditor.getCompilerDefinition();
|
||||
var compilerPreferences = languageEditor.getCompilerPreferences();
|
||||
var compilerExecutablePath = compilerPreferences.getCompilerExecutablePathOrDefault();
|
||||
var languagePreferences = languageEditor.getLanguagePreferences();
|
||||
var compilerExecutablePath = languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition);
|
||||
|
||||
try {
|
||||
var helpDocument = compilerDefinition.getInstalledHelpForCurrentLocale(compilerExecutablePath);
|
||||
|
@ -120,7 +120,7 @@ public final class LanguageEditorFilesLogic {
|
||||
}
|
||||
}
|
||||
result = new CompilerFiles(mainSourceIFile, mainSourceFileProperties, sourceIFile, sourceFileProperties,
|
||||
languageEditor.getCompilerPreferences());
|
||||
languageEditor.getLanguageHardwareCompilerPreferences());
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
|
@ -47,22 +47,21 @@ final class LanguageRuleBasedScanner extends RuleBasedScanner {
|
||||
* Creates a new instance. Called by {@link LanguageSourceViewerConfiguration}.
|
||||
*
|
||||
* @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
|
||||
* {@link LanguagePreferencesConstants}
|
||||
*/
|
||||
LanguageRuleBasedScanner(LanguagePreferences languagePreferences, String textAttributeName) {
|
||||
LanguageRuleBasedScanner(LanguagePreferences languagePreferences, String preferencesKey) {
|
||||
|
||||
if (languagePreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
if (textAttributeName == null) {
|
||||
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null.");
|
||||
if (preferencesKey == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
|
||||
}
|
||||
this.preferencesKey = LanguagePreferencesConstants.getPreferencesKey(languagePreferences.getLanguage(),
|
||||
textAttributeName);
|
||||
this.preferencesKey = preferencesKey;
|
||||
|
||||
defaultToken = new Token(languagePreferences.getEditorTextAttribute(textAttributeName));
|
||||
defaultToken = new Token(languagePreferences.getTextAttribute(preferencesKey));
|
||||
|
||||
super.setDefaultReturnToken(defaultToken);
|
||||
}
|
||||
@ -94,7 +93,7 @@ final class LanguageRuleBasedScanner extends RuleBasedScanner {
|
||||
boolean refresh = false;
|
||||
if (changedPropertyNames.contains(preferencesKey)) {
|
||||
TextAttributeConverter.dispose((TextAttribute) defaultToken.getData());
|
||||
defaultToken.setData(preferences.getLanguagesPreferences().getEditorTextAttribute(preferencesKey));
|
||||
defaultToken.setData(preferences.getTextAttribute(preferencesKey));
|
||||
refresh = true;
|
||||
}
|
||||
return refresh;
|
||||
|
@ -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.InstructionType;
|
||||
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.LanguagePreferencesConstants;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
|
||||
import com.wudsn.ide.lng.preferences.TextAttributeConverter;
|
||||
|
||||
/**
|
||||
@ -397,27 +399,27 @@ final class LanguageSourceScanner extends RuleBasedScanner {
|
||||
private void createTokens() {
|
||||
|
||||
// Numbers
|
||||
numberToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER);
|
||||
numberToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER);
|
||||
|
||||
// Instructions
|
||||
directiveToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE);
|
||||
legalOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL);
|
||||
illegalOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL);
|
||||
pseudoOpcodeToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO);
|
||||
directiveToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE);
|
||||
legalOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL);
|
||||
illegalOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL);
|
||||
pseudoOpcodeToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO);
|
||||
|
||||
// Identifiers
|
||||
equateIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE);
|
||||
labelIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL);
|
||||
enumDefinitionSectionIdentifierToken = createToken(
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION);
|
||||
structureDefinitionSectionIdentifierToken = createToken(
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION);
|
||||
localSectionIdentifierToken = createToken(
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION);
|
||||
macroDefinitionSectionIdentifierToken = createToken(
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION);
|
||||
procedureDefinitionSectionIdentifierToken = createToken(
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION);
|
||||
equateIdentifierToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE);
|
||||
labelIdentifierToken = createLanguageToken(EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL);
|
||||
enumDefinitionSectionIdentifierToken = createLanguageToken(
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION);
|
||||
structureDefinitionSectionIdentifierToken = createLanguageToken(
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION);
|
||||
localSectionIdentifierToken = createLanguageToken(
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION);
|
||||
macroDefinitionSectionIdentifierToken = createLanguageToken(
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION);
|
||||
procedureDefinitionSectionIdentifierToken = createLanguageToken(
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION);
|
||||
|
||||
}
|
||||
|
||||
@ -428,14 +430,13 @@ final class LanguageSourceScanner extends RuleBasedScanner {
|
||||
* <code>null</code>.
|
||||
* @return The new token, not <code>null</code>.
|
||||
*/
|
||||
private IToken createToken(String textAttributeName) {
|
||||
private IToken createLanguageToken(String textAttributeName) {
|
||||
if (textAttributeName == null) {
|
||||
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null.");
|
||||
}
|
||||
LanguagePreferences preferences = editor.getLanguagePreferences();
|
||||
String preferencesKey = LanguagePreferencesConstants.getPreferencesKey(preferences.getLanguage(),
|
||||
textAttributeName);
|
||||
Token token = new Token(preferences.getEditorTextAttribute(textAttributeName));
|
||||
var preferences = editor.getLanguagePreferences();
|
||||
var preferencesKey = EditorConstants.getEditorAttributeKey(preferences.getLanguage(), textAttributeName);
|
||||
var token = new Token(preferences.getTextAttribute(preferencesKey));
|
||||
tokens.put(preferencesKey, token);
|
||||
return token;
|
||||
}
|
||||
@ -482,27 +483,29 @@ final class LanguageSourceScanner extends RuleBasedScanner {
|
||||
* {@link LanguageSourceViewerConfiguration}.
|
||||
*
|
||||
* @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>.
|
||||
*
|
||||
* @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) {
|
||||
throw new IllegalArgumentException("Parameter 'preferences' must not be null.");
|
||||
}
|
||||
if (changedPropertyNames == null) {
|
||||
if (changedPreferencesKeys == null) {
|
||||
throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null.");
|
||||
}
|
||||
boolean refresh = false;
|
||||
for (String propertyName : changedPropertyNames) {
|
||||
Token token = tokens.get(propertyName);
|
||||
var compilerTargetPreferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
|
||||
.getCompilerTargetName(editor.getLanguage(), editor.getHardware(), editor.getCompilerDefinition());
|
||||
for (String preferencesKey : changedPreferencesKeys) {
|
||||
Token token = tokens.get(preferencesKey);
|
||||
if (token != null) {
|
||||
TextAttributeConverter.dispose((TextAttribute) token.getData());
|
||||
token.setData(preferences.getLanguagesPreferences().getEditorTextAttribute(propertyName));
|
||||
token.setData(preferences.getTextAttribute(preferencesKey));
|
||||
refresh = true;
|
||||
|
||||
} else if (LanguagePreferencesConstants.isCompilerTargetName(propertyName)) {
|
||||
} else if (compilerTargetPreferencesKey.equals(preferencesKey)) {
|
||||
CompilerSourceParser compilerSourceParser = editor.createCompilerSourceParser();
|
||||
wordRule.setCompilerSourceParser(compilerSourceParser);
|
||||
wordRule.setInstructions();
|
||||
|
@ -40,7 +40,7 @@ import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
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.
|
||||
@ -140,7 +140,7 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
|
||||
if (changedPropertyNames == null) {
|
||||
throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null.");
|
||||
}
|
||||
boolean refresh = false;
|
||||
var refresh = false;
|
||||
refresh |= commentSingleScanner.preferencesChanged(preferences, changedPropertyNames);
|
||||
refresh |= commentMultipleScanner.preferencesChanged(preferences, changedPropertyNames);
|
||||
refresh |= stringScanner.preferencesChanged(preferences, changedPropertyNames);
|
||||
@ -168,25 +168,26 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
|
||||
if (sourceViewer == null) {
|
||||
throw new IllegalArgumentException("Parameter 'sourceViewer' must not be null.");
|
||||
}
|
||||
PresentationReconciler reconciler = new PresentationReconciler();
|
||||
DefaultDamagerRepairer dr;
|
||||
var reconciler = new PresentationReconciler();
|
||||
|
||||
LanguagePreferences languagePreferences = editor.getLanguagePreferences();
|
||||
var languagePreferences = editor.getLanguagePreferences();
|
||||
var language = languagePreferences.getLanguage();
|
||||
|
||||
commentSingleScanner = new LanguageRuleBasedScanner(languagePreferences,
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
dr = new DefaultDamagerRepairer(commentSingleScanner);
|
||||
var preferencesKey = EditorConstants.getEditorAttributeKey(language,
|
||||
EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
commentSingleScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
|
||||
var dr = new DefaultDamagerRepairer(commentSingleScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
|
||||
|
||||
commentMultipleScanner = new LanguageRuleBasedScanner(languagePreferences,
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
preferencesKey = EditorConstants.getEditorAttributeKey(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
commentMultipleScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
|
||||
dr = new DefaultDamagerRepairer(commentMultipleScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
|
||||
|
||||
stringScanner = new LanguageRuleBasedScanner(languagePreferences,
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING);
|
||||
preferencesKey = EditorConstants.getEditorAttributeKey(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_STRING);
|
||||
stringScanner = new LanguageRuleBasedScanner(languagePreferences, preferencesKey);
|
||||
dr = new DefaultDamagerRepairer(stringScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
|
||||
@ -206,16 +207,18 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat
|
||||
}
|
||||
IReconcilingStrategy reconcilingStrategy = new LanguageReconcilingStategy(editor);
|
||||
|
||||
MonoReconciler reconciler = new MonoReconciler(reconcilingStrategy, false);
|
||||
var reconciler = new MonoReconciler(reconcilingStrategy, false);
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
|
||||
Map<String, IAdaptable> targets = super.getHyperlinkDetectorTargets(sourceViewer);
|
||||
var targets = super.getHyperlinkDetectorTargets(sourceViewer);
|
||||
targets.put(LanguageHyperlinkDetector.TARGET, editor);
|
||||
return targets;
|
||||
}
|
||||
|
@ -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.Opcode;
|
||||
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.runner.RunnerDefinition;
|
||||
import com.wudsn.ide.lng.runner.RunnerId;
|
||||
@ -301,20 +300,16 @@ public final class LanguageHelpContentProducer implements IHelpContentProducer {
|
||||
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
|
||||
// Find non-empty compiler executable path.
|
||||
Language language = Language.valueOf(languageString);
|
||||
String compilerKey = CompilerDefinition.getKey(language, compilerId);
|
||||
CompilerDefinition compilerDefinition = compilerRegistry.getCompilerByKey(compilerKey).getDefinition();
|
||||
|
||||
var language = Language.valueOf(languageString);
|
||||
var compilerDefinition = compilerRegistry.getCompilerDefinitionById(language, compilerId);
|
||||
if (section.startsWith(SECTION_GENERAL)) {
|
||||
return getInputStream(getCompilerGeneralSection(compilerDefinition));
|
||||
} else if (section.startsWith(SECTION_MANUAL)) {
|
||||
LanguagePreferences languagePreferences = languagePlugin.getLanguagePreferences(language);
|
||||
CompilerPreferences compilerPreferences = languagePreferences.getCompilerPreferences(compilerDefinition,
|
||||
Hardware.GENERIC);
|
||||
|
||||
try {
|
||||
var helpDocDocument = compilerDefinition
|
||||
.getInstalledHelpForCurrentLocale(compilerPreferences.getCompilerExecutablePathOrDefault());
|
||||
var helpDocDocument = compilerDefinition.getInstalledHelpForCurrentLocale(
|
||||
languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition));
|
||||
File file = helpDocDocument.file;
|
||||
if (file == null) {
|
||||
throw new RuntimeException(
|
||||
|
@ -262,8 +262,7 @@ public final class LanguageTocProvider extends AbstractTocProvider {
|
||||
|
||||
var languagePreferences = LanguagePlugin.getInstance()
|
||||
.getLanguagePreferences(compilerDefinition.getLanguage());
|
||||
var compilerPreferences = languagePreferences.getCompilerPreferences(compilerDefinition, Hardware.GENERIC);
|
||||
var compilerExecutablePath = compilerPreferences.getCompilerExecutablePathOrDefault();
|
||||
var compilerExecutablePath = languagePreferences.getCompilerExecutablePathOrDefault(compilerDefinition);
|
||||
|
||||
var icon = "";
|
||||
var manualTopics = new ArrayList<ITopic>();
|
||||
|
@ -32,18 +32,18 @@ import com.wudsn.ide.lng.LanguageProperties;
|
||||
*/
|
||||
public final class CompilerRunPreferences {
|
||||
|
||||
private CompilerPreferences compilerPreferences;
|
||||
private LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences;
|
||||
private LanguageProperties mainSourceFileProperties;
|
||||
|
||||
public CompilerRunPreferences(CompilerPreferences compilerPreferences,
|
||||
public CompilerRunPreferences(LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences,
|
||||
LanguageProperties mainSourceFileProperties) {
|
||||
if (compilerPreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerPreferences' must not be null.");
|
||||
if (languageHardwareCompilerDefinitionPreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'languageHardwareCompilerDefinitionPreferences' must not be null.");
|
||||
}
|
||||
if (mainSourceFileProperties == null) {
|
||||
throw new IllegalArgumentException("Parameter 'properties' must not be null.");
|
||||
}
|
||||
this.compilerPreferences = compilerPreferences;
|
||||
this.languageHardwareCompilerDefinitionPreferences = languageHardwareCompilerDefinitionPreferences;
|
||||
this.mainSourceFileProperties = mainSourceFileProperties;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ public final class CompilerRunPreferences {
|
||||
* @since 1.6.1
|
||||
*/
|
||||
public Hardware getHardware() {
|
||||
return compilerPreferences.getHardware();
|
||||
return languageHardwareCompilerDefinitionPreferences.getHardware();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ public final class CompilerRunPreferences {
|
||||
|
||||
String result;
|
||||
|
||||
result = compilerPreferences.getParameters();
|
||||
result = languageHardwareCompilerDefinitionPreferences.getParameters();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ public final class CompilerRunPreferences {
|
||||
public String getRunnerId() {
|
||||
String result;
|
||||
|
||||
result = compilerPreferences.getRunnerId();
|
||||
result = languageHardwareCompilerDefinitionPreferences.getRunnerId();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public final class CompilerRunPreferences {
|
||||
|
||||
String result;
|
||||
|
||||
result = compilerPreferences.getRunnerExecutablePath(runnerId);
|
||||
result = languageHardwareCompilerDefinitionPreferences.getRunnerExecutablePath(runnerId);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ public final class CompilerRunPreferences {
|
||||
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
|
||||
}
|
||||
String result;
|
||||
result = compilerPreferences.getRunnerCommandLine(runnerId);
|
||||
result = languageHardwareCompilerDefinitionPreferences.getRunnerCommandLine(runnerId);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public final class CompilerRunPreferences {
|
||||
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
|
||||
}
|
||||
boolean result;
|
||||
result = compilerPreferences.isRunnerWaitForCompletion(runnerId);
|
||||
result = languageHardwareCompilerDefinitionPreferences.isRunnerWaitForCompletion(runnerId);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1,281 +1,222 @@
|
||||
/**
|
||||
* 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 java.io.File;
|
||||
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode;
|
||||
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.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class CompilerPreferences {
|
||||
|
||||
private LanguagePreferences languagePreferences;
|
||||
private Hardware hardware;
|
||||
private String compilerId;
|
||||
|
||||
CompilerPreferences(LanguagePreferences languagePreferences, String compilerId, Hardware hardware) {
|
||||
if (languagePreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'languagePreferences' must not be null.");
|
||||
}
|
||||
if (compilerId == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
|
||||
}
|
||||
if (StringUtility.isEmpty(compilerId)) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerId' must not be empty.");
|
||||
}
|
||||
if (hardware == null) {
|
||||
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
|
||||
}
|
||||
this.languagePreferences = languagePreferences;
|
||||
this.compilerId = compilerId;
|
||||
this.hardware = hardware;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the compiler id of the compiler.
|
||||
*
|
||||
* @return The compiler id of the compiler, not empty and not <code>null</code>.
|
||||
*/
|
||||
public String getCompilerId() {
|
||||
return compilerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configured executable path for the compiler.
|
||||
*
|
||||
* @return The executable path for the runner, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getCompilerExecutablePath() {
|
||||
return languagePreferences.getString(LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the executable path for the compiler.
|
||||
*
|
||||
* @return The executable path for the runner, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getCompilerExecutablePathOrDefault() {
|
||||
String compilerExecutablePath = getCompilerExecutablePath();
|
||||
|
||||
CompilerPaths compilerPaths = LanguagePlugin.getInstance().getCompilerPaths();
|
||||
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
||||
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(languagePreferences.getLanguage(),
|
||||
compilerId);
|
||||
if (compilerPath != null) {
|
||||
File compilerFile = compilerPath.getAbsoluteFile();
|
||||
if (compilerFile != null) {
|
||||
if (compilerFile.exists() && compilerFile.isFile() && compilerFile.canExecute()) {
|
||||
compilerExecutablePath = compilerFile.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return compilerExecutablePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hardware for which the compiler is invoked.
|
||||
*
|
||||
* @return The hardware, not <code>null</code>.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
public Hardware getHardware() {
|
||||
return hardware;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Target for which the instructions shall be active.
|
||||
*
|
||||
* @return The Target, not <code>null</code>.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
public Target getTarget() {
|
||||
Target result;
|
||||
String targetString = languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware));
|
||||
|
||||
if (StringUtility.isEmpty(targetString)) {
|
||||
result = Target.MOS6502;
|
||||
} else {
|
||||
result = Target.valueOf(targetString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if illegal opcodes shall be highlighted and proposed.
|
||||
*
|
||||
* @return <code>true</code> if yet, <code>false</code> otherwise.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isIllegalOpcodesVisible() {
|
||||
return getTarget() == Target.MOS6502_ILLEGAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if W65816 opcodes shall be highlighted and proposed.
|
||||
*
|
||||
* @return <code>true</code> if yet, <code>false</code> otherwise.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isW65816OpcodesVisible() {
|
||||
return getTarget() == Target.MOS65816;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameters for the compiler.
|
||||
*
|
||||
* @return The parameters path for the compiler, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getParameters() {
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output folder mode for the compiler.
|
||||
*
|
||||
* @return The output folder mode for the compiler, see
|
||||
* {@link CompilerOutputFolderMode}, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getOutputFolderMode() {
|
||||
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output folder for the compiler in case the output folder mode is
|
||||
* {@link CompilerOutputFolderMode#FIXED_FOLDER}.
|
||||
*
|
||||
* @return The output folder mode for the compiler, see
|
||||
* {@link CompilerOutputFolderMode#FIXED_FOLDER}, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getOutputFolderPath() {
|
||||
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output file extension for the compiler.
|
||||
*
|
||||
* @return The output file extension may be empty, not <code>null</code>.
|
||||
*/
|
||||
public String getOutputFileExtension() {
|
||||
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id of the default runner to run the output file.
|
||||
*
|
||||
* @return The id of the runner to run the output file, not empty and not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getRunnerId() {
|
||||
String result = languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware));
|
||||
if (StringUtility.isEmpty(result)) {
|
||||
result = RunnerId.DEFAULT_APPLICATION;
|
||||
}
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 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.common.StringUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode;
|
||||
import com.wudsn.ide.lng.runner.RunnerId;
|
||||
|
||||
/**
|
||||
* Facade class for typed access to the global compiler preferences for a given
|
||||
* hardware.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class LanguageHardwareCompilerDefinitionPreferences {
|
||||
|
||||
private LanguagePreferences languagePreferences;
|
||||
private Language language;
|
||||
private Hardware hardware;
|
||||
private CompilerDefinition compilerDefinition;
|
||||
|
||||
LanguageHardwareCompilerDefinitionPreferences(LanguagePreferences languagePreferences, Hardware hardware,
|
||||
CompilerDefinition compilerDefinition) {
|
||||
if (languagePreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'languagePreferences' must not be null.");
|
||||
}
|
||||
if (compilerDefinition == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
|
||||
}
|
||||
if (hardware == null) {
|
||||
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
|
||||
}
|
||||
this.languagePreferences = languagePreferences;
|
||||
this.language = this.languagePreferences.getLanguage();
|
||||
this.compilerDefinition = compilerDefinition;
|
||||
this.hardware = hardware;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hardware for which the compiler is invoked.
|
||||
*
|
||||
* @return The hardware, not <code>null</code>.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
public Hardware getHardware() {
|
||||
return hardware;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the compiler definition.
|
||||
*
|
||||
* @return The compiler definition, not <code>null</code>.
|
||||
*/
|
||||
public CompilerDefinition getCompilerDefinition() {
|
||||
return compilerDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Target for which the instructions shall be active.
|
||||
*
|
||||
* @return The Target, not <code>null</code>.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
public Target getTarget() {
|
||||
Target result;
|
||||
String targetString = languagePreferences
|
||||
.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerTargetName(language, hardware, compilerDefinition));
|
||||
|
||||
if (StringUtility.isEmpty(targetString)) {
|
||||
result = Target.MOS6502;
|
||||
} else {
|
||||
result = Target.valueOf(targetString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameters for the compiler.
|
||||
*
|
||||
* @return The parameters path for the compiler, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getParameters() {
|
||||
return languagePreferences.getString(
|
||||
LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerParametersName(language, hardware, compilerDefinition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output folder mode for the compiler.
|
||||
*
|
||||
* @return The output folder mode for the compiler, see
|
||||
* {@link CompilerOutputFolderMode}, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getOutputFolderMode() {
|
||||
|
||||
return languagePreferences.getString(
|
||||
LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFolderModeName(language, hardware, compilerDefinition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output folder for the compiler in case the output folder mode is
|
||||
* {@link CompilerOutputFolderMode#FIXED_FOLDER}.
|
||||
*
|
||||
* @return The output folder mode for the compiler, see
|
||||
* {@link CompilerOutputFolderMode#FIXED_FOLDER}, may be empty, not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getOutputFolderPath() {
|
||||
|
||||
return languagePreferences.getString(
|
||||
LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFolderPathName(language, hardware, compilerDefinition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output file extension for the compiler.
|
||||
*
|
||||
* @return The output file extension may be empty, not <code>null</code>.
|
||||
*/
|
||||
public String getOutputFileExtension() {
|
||||
|
||||
return languagePreferences.getString(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerOutputFileExtensionName(language,
|
||||
hardware, compilerDefinition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id of the default runner to run the output file.
|
||||
*
|
||||
* @return The id of the runner to run the output file, not empty and not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public String getRunnerId() {
|
||||
String result = languagePreferences.getString(
|
||||
LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerIdName(language, hardware, compilerDefinition));
|
||||
if (StringUtility.isEmpty(result)) {
|
||||
result = RunnerId.DEFAULT_APPLICATION;
|
||||
}
|
||||
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(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerExecutablePathName(language,
|
||||
hardware, compilerDefinition, 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(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerRunnerCommandLineName(language,
|
||||
hardware, compilerDefinition, 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(LanguageHardwareCompilerDefinitionPreferencesConstants
|
||||
.getCompilerRunnerWaitForCompletionName(language, hardware, compilerDefinition, runnerId));
|
||||
}
|
||||
|
||||
}
|
@ -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$
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -19,12 +19,19 @@
|
||||
|
||||
package com.wudsn.ide.lng.preferences;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.jface.text.TextAttribute;
|
||||
|
||||
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.lng.Language;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
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.LanguageEditorCompileCommandPositioningMode;
|
||||
|
||||
@ -72,7 +79,7 @@ public final class LanguagePreferences {
|
||||
* See {@link LanguageContentAssistProcessorDefaultCase}.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param compilerDefinition The compiler definition, not empty and not
|
||||
* <code>null</code>.
|
||||
* @param hardware The preferences or <code>null</code> if the
|
||||
* 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>.
|
||||
*/
|
||||
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) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerDefinition' must not be null.");
|
||||
}
|
||||
|
||||
if (hardware == null) {
|
||||
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
|
||||
}
|
||||
return new CompilerPreferences(this, compilerDefinition.getId(), hardware);
|
||||
return new LanguageHardwareCompilerDefinitionPreferences(this, hardware, compilerDefinition);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>.
|
||||
* @return The language preferences key, 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
|
||||
* class, not empty, not <code>null</code>
|
||||
* @return
|
||||
*/
|
||||
public String getPreferencesKey(String preferencesKeySuffix) {
|
||||
return LanguagePreferencesConstants.getPreferencesKey(language, preferencesKeySuffix);
|
||||
public static String getLanguagePreferencesKey(Language language, String preferencesKeySuffix) {
|
||||
return language.name().toLowerCase() + "." + preferencesKeySuffix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
* name, or if the current value cannot be treated as a boolean.
|
||||
*
|
||||
* @param preferencesKeySuffix The he preferences key suffix of the preference,
|
||||
* not <code>null</code>.
|
||||
* @param preferencesKey The key of the preference, not empty and not
|
||||
* <code>null</code>.
|
||||
* @return The preference value.
|
||||
*/
|
||||
boolean getBoolean(String preferencesKeySuffix) {
|
||||
if (preferencesKeySuffix == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKeySuffix' must not be null.");
|
||||
boolean getBoolean(String preferencesKey) {
|
||||
if (preferencesKey == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
|
||||
}
|
||||
return languagesPreferences
|
||||
.getBoolean(getPreferencesKey(preferencesKeySuffix));
|
||||
return languagesPreferences.getBoolean(preferencesKey);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the current value of the string-valued preference with the given name.
|
||||
* 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
|
||||
* treated as a string.
|
||||
*
|
||||
* @param preferencesKeySuffix The preferences key suffix of the preference, not
|
||||
* <code>null</code>.
|
||||
* @param preferencesKey The key of the preference, not empty and not
|
||||
* <code>null</code>.
|
||||
*
|
||||
* @return The preference value, may be empty, not <code>null</code>.
|
||||
*/
|
||||
String getString(String preferencesKeySuffix) {
|
||||
if (preferencesKeySuffix == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKeySuffix' must not be null.");
|
||||
String getString(String preferencesKey) {
|
||||
if (preferencesKey == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
|
||||
}
|
||||
return languagesPreferences
|
||||
.getString(getPreferencesKey(preferencesKeySuffix));
|
||||
return languagesPreferences.getString(preferencesKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the text attribute for a token type.
|
||||
*
|
||||
* @param textAttributeName The suffix of the preferences for the token type,
|
||||
* see {@link LanguagePreferencesConstants}.
|
||||
* @param preferencesKey The key of the preference, not empty and not
|
||||
* <code>null</code>.
|
||||
*
|
||||
* @return The text attribute, not <code>null</code>.
|
||||
*/
|
||||
public TextAttribute getEditorTextAttribute(String textAttributeName) {
|
||||
if (textAttributeName == null) {
|
||||
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null.");
|
||||
public TextAttribute getTextAttribute(String preferencesKey) {
|
||||
if (preferencesKey == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
|
||||
}
|
||||
return languagesPreferences
|
||||
.getEditorTextAttribute(getPreferencesKey(textAttributeName));
|
||||
return languagesPreferences.getEditorTextAttribute(preferencesKey);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,464 +1,303 @@
|
||||
/**
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
|
||||
/**
|
||||
* Constants for preferences. The string constants are preferences key suffix
|
||||
* that are not used directly but prefixes with the language.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class LanguagePreferencesConstants {
|
||||
|
||||
/**
|
||||
* Creation is private.
|
||||
*/
|
||||
private LanguagePreferencesConstants() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Preference key for comment text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_COMMENT = "editor.text.attribute.comment"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preferences key for string text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_STRING = "editor.text.attribute.string"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preferences key for number text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_NUMBER = "editor.text.attribute.number"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for directive text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_DIRECTVE = "editor.text.attribute.directive"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for legal opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL = "editor.text.attribute.opcode.legal"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for illegal opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL = "editor.text.attribute.opcode.illegal"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for pseudo opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO = "editor.text.attribute.opcode.pseudo"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for equate identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE = "editor.text.attribute.identifier.equate"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for label identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL = "editor.text.attribute.identifier.label"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for enum identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION = "editor.text.attribute.identifier.enum"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for structure identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION = "editor.text.attribute.identifier.structure"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for local identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION = "editor.text.attribute.identifier.local"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for macro identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION = "editor.text.attribute.identifier.macro"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* 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$
|
||||
|
||||
/**
|
||||
* Preference key for default case for content assist.
|
||||
*/
|
||||
static final String EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE = "editor.content.assist.processor.default.case"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for positioning for for compiling.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
static final String EDITOR_COMPILE_COMMAND_POSITIONING_MODE = "editor.compile.command.positioning.mode"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Create the preferences key for a property of a given language.
|
||||
*
|
||||
* @param language The language, not <code>null</code>
|
||||
* @param preferencesKeySuffix The suffix as defined by the constants of this
|
||||
* class, not empty, not <code>null</code>
|
||||
* @return
|
||||
*/
|
||||
public static String getPreferencesKey(Language language, String preferencesKeySuffix) {
|
||||
return language.name().toLowerCase() + "." + preferencesKeySuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of all preferences keys that depend on the global JFact text font
|
||||
* setting.
|
||||
*/
|
||||
public static List<TextAttributeDefinition> getTextAttributeDefinitions(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
|
||||
List<TextAttributeDefinition> result = new ArrayList<TextAttributeDefinition>();
|
||||
|
||||
// Comments and literals
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_COMMENT),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_COMMENT_NAME));
|
||||
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));
|
||||
|
||||
switch (language) {
|
||||
case ASM: {
|
||||
|
||||
// Built-in
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
|
||||
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),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_LEGAL_NAME));
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_PSEUDO_NAME));
|
||||
|
||||
// Identifiers
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE));
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LABEL));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case PAS: {
|
||||
|
||||
// Built-in
|
||||
result.add(new TextAttributeDefinition(getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
|
||||
|
||||
// Identifiers
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getPreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported language " + language + ".");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if preference key name represents a setting for compiler targets
|
||||
* visibility.
|
||||
*
|
||||
* @param name The name of the preferences key, not <code>null</code>.
|
||||
* @return <code>true</code> if preference key name represents a setting for
|
||||
* compiler opcodes visibility, <code>false</code> otherwise.
|
||||
*/
|
||||
public static boolean isCompilerTargetName(String name) {
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException("Parameter 'name' must not be null.");
|
||||
}
|
||||
boolean result = name.startsWith("compiler.") && name.endsWith(".target");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets preference key name for the compiler executable path. This is the only
|
||||
* hardware independent compiler setting.
|
||||
*
|
||||
* @param compilerId The compiler id, not <code>null</code>.
|
||||
*
|
||||
* @return The preference key name for the compiler executable path, not empty
|
||||
* and not <code>null</code>.
|
||||
*/
|
||||
static String getCompilerExecutablePathName(String compilerId) {
|
||||
|
||||
if (compilerId == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
|
||||
}
|
||||
return "compiler." + compilerId + ".executable.path"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets preference key name for the compiler Target visibility.
|
||||
*
|
||||
* @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 Target, not empty and not
|
||||
* <code>null</code>.
|
||||
*/
|
||||
static String getCompilerTargetName(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) + ".target"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets preference key name for the compiler parameters.
|
||||
*
|
||||
* @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 parameters, not empty and
|
||||
* not <code>null</code>.
|
||||
*/
|
||||
static String getCompilerParametersName(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) + ".default.parameters"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets preference key name for the compiler output folder mode.
|
||||
*
|
||||
* @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 mode, not
|
||||
* empty and not <code>null</code>.
|
||||
*/
|
||||
static String getCompilerOutputFolderModeName(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.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();
|
||||
}
|
||||
}
|
||||
/**
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
|
||||
|
||||
/**
|
||||
* Constants for preferences.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class LanguagePreferencesConstants {
|
||||
|
||||
public static final class EditorConstants {
|
||||
/**
|
||||
* Preference key for comment text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_COMMENT = "editor.text.attribute.comment"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preferences key for string text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_STRING = "editor.text.attribute.string"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preferences key for number text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_NUMBER = "editor.text.attribute.number"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for directive text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_DIRECTVE = "editor.text.attribute.directive"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for legal opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL = "editor.text.attribute.opcode.legal"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for illegal opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL = "editor.text.attribute.opcode.illegal"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for pseudo opcode text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO = "editor.text.attribute.opcode.pseudo"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for equate identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE = "editor.text.attribute.identifier.equate"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for label identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL = "editor.text.attribute.identifier.label"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for enum identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION = "editor.text.attribute.identifier.enum"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for structure identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION = "editor.text.attribute.identifier.structure"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for local identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION = "editor.text.attribute.identifier.local"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for macro identifier text style.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION = "editor.text.attribute.identifier.macro"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for default case for content assist.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
public static final String EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION = "editor.text.attribute.identifier.procedure"; //$NON-NLS-1$
|
||||
|
||||
|
||||
/**
|
||||
* Preference key for positioning for for compiling.
|
||||
*
|
||||
* @since 1.6.1
|
||||
*/
|
||||
static final String EDITOR_COMPILE_COMMAND_POSITIONING_MODE = "editor.compile.command.positioning.mode"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Gets preference key name for a editor attribute.
|
||||
*
|
||||
* @param language The language <code>null</code>.
|
||||
*
|
||||
* @return The preference key name for the compiler executable path, not empty
|
||||
* and not <code>null</code>.
|
||||
*/
|
||||
public static String getEditorAttributeKey(Language language, String textAttributeName) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
String preferencesKey = getLanguagePreferencesKey(language, textAttributeName);
|
||||
return preferencesKey;
|
||||
}
|
||||
|
||||
static String getEditorContentProcessorDefaultCaseKey(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
|
||||
return getEditorAttributeKey(language, EditorConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE);
|
||||
}
|
||||
|
||||
static String getEditorCompileCommandPositioningModeKey(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
|
||||
return getEditorAttributeKey(language, EditorConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of all preferences keys that depend on the global JFact text
|
||||
* font setting.
|
||||
*
|
||||
* @param language The language, not <code>null</code>.
|
||||
*/
|
||||
public static List<TextAttributeDefinition> getTextAttributeDefinitions(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
|
||||
List<TextAttributeDefinition> result = new ArrayList<TextAttributeDefinition>();
|
||||
|
||||
// Comments and literals
|
||||
result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_COMMENT),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_COMMENT_NAME));
|
||||
result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_NUMBER),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_NUMBER_NAME));
|
||||
result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_STRING),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_STRING_NAME));
|
||||
|
||||
switch (language) {
|
||||
case ASM: {
|
||||
|
||||
// Built-in
|
||||
result.add(new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_ILLEGAL_NAME));
|
||||
result.add(
|
||||
new TextAttributeDefinition(getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_LEGAL_NAME));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_PSEUDO_NAME));
|
||||
|
||||
// Identifiers
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LABEL));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getEditorAttributeKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case PAS: {
|
||||
|
||||
// Built-in
|
||||
result.add(
|
||||
new TextAttributeDefinition(getLanguagePreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_DIRECTVE),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE));
|
||||
|
||||
// Identifiers
|
||||
result.add(new TextAttributeDefinition(
|
||||
getLanguagePreferencesKey(language, EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getLanguagePreferencesKey(language,
|
||||
EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION));
|
||||
result.add(new TextAttributeDefinition(
|
||||
getLanguagePreferencesKey(language,
|
||||
EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION),
|
||||
Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION));
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported language " + language + ".");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation is private.
|
||||
*/
|
||||
private LanguagePreferencesConstants() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if preference key name represents a setting for compiler targets
|
||||
* visibility.
|
||||
*
|
||||
* @param name The name of the preferences key, not <code>null</code>.
|
||||
* @return <code>true</code> if preference key name represents a setting for
|
||||
* compiler opcodes visibility, <code>false</code> otherwise.
|
||||
*/
|
||||
public static boolean isCompilerTargetName(Language language, String preferencesKey) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
if (preferencesKey == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null.");
|
||||
}
|
||||
var prefix = getLanguagePreferencesKey(language, "compiler.");
|
||||
boolean result = preferencesKey.startsWith(prefix) && preferencesKey.endsWith(".target");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the preferences key for a property of a given language.
|
||||
*
|
||||
* @param language The language, not <code>null</code>
|
||||
* @param preferencesKeySuffix The suffix as defined by the constants of this
|
||||
* class, not empty, not <code>null</code>
|
||||
* @return
|
||||
*/
|
||||
static String getLanguagePreferencesKey(Language language, String preferencesKeySuffix) {
|
||||
return language.name().toLowerCase() + "." + preferencesKeySuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets preference key name for the compiler executable path. This is the only
|
||||
* hardware independent compiler setting.
|
||||
*
|
||||
* @param The language, not <code>null</code>
|
||||
* @param compilerDefinition The compiler definition, not <code>null</code>.
|
||||
*
|
||||
* @return The preference key name for the compiler executable path, not empty
|
||||
* and not <code>null</code>.
|
||||
*/
|
||||
static String getCompilerExecutablePathKey(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.");
|
||||
}
|
||||
return getLanguagePreferencesKey(language, "compiler." + compilerDefinition.getId() + ".executable.path"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
package com.wudsn.ide.lng.preferences;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
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.lng.Language;
|
||||
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.CompilerRegistry;
|
||||
import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase;
|
||||
import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
|
||||
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) {
|
||||
store.setDefault(language.name().toLowerCase() + "." + key, value);
|
||||
private void setDefault(String key, String 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.
|
||||
Display display = Display.getCurrent();
|
||||
TextAttribute textAttribute = new TextAttribute(new Color(display, r, g, b), null, style);
|
||||
store.setDefault(language.name().toLowerCase() + "." + key, TextAttributeConverter.toString(textAttribute));
|
||||
var display = Display.getCurrent();
|
||||
var textAttribute = new TextAttribute(new Color(display, r, g, b), null, style);
|
||||
var preferencesKey = LanguagePreferencesConstants.EditorConstants.getEditorAttributeKey(language,
|
||||
textAttributeName);
|
||||
setDefault(preferencesKey, TextAttributeConverter.toString(textAttribute));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,56 +82,62 @@ public final class LanguagePreferencesInitializer extends AbstractPreferenceInit
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
initializeEditorPreferences(language);
|
||||
initializeCompilerPreferences(language);
|
||||
initializeHardwareCompilerDefinitionPreferences(language);
|
||||
}
|
||||
|
||||
private void initializeEditorPreferences(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT, 0, 128, 0, SWT.ITALIC);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE, 128, 64, 0, SWT.BOLD);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER, 0, 0, 255, SWT.BOLD);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL, 0, 0, 128, SWT.BOLD);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL, 255, 32, 32, SWT.BOLD);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO, 32, 128, 32, SWT.BOLD);
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING, 0, 0, 255, SWT.NORMAL);
|
||||
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT, 0, 128, 0, SWT.ITALIC);
|
||||
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE, 128, 64, 0, SWT.BOLD);
|
||||
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER, 0, 0, 255, SWT.BOLD);
|
||||
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL, 0, 0, 128,
|
||||
SWT.BOLD);
|
||||
setLanguageTextAttributeDefault(language, EditorConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL, 255, 32, 32,
|
||||
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.
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE,
|
||||
LanguageContentAssistProcessorDefaultCase.LOWER_CASE);
|
||||
var preferencesKey = EditorConstants.getEditorContentProcessorDefaultCaseKey(language);
|
||||
setDefault(preferencesKey, LanguageContentAssistProcessorDefaultCase.LOWER_CASE);
|
||||
|
||||
// Compiling.
|
||||
setDefault(language, LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
LanguageEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING);
|
||||
preferencesKey = EditorConstants.getEditorCompileCommandPositioningModeKey(language);
|
||||
setDefault(preferencesKey, LanguageEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING);
|
||||
}
|
||||
|
||||
private void initializeCompilerPreferences(Language language) {
|
||||
private void initializeHardwareCompilerDefinitionPreferences(Language language) {
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
LanguagePlugin languagePlugin = LanguagePlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
List<CompilerDefinition> compilerDefinitions = compilerRegistry.getCompilerDefinitions(language);
|
||||
for (CompilerDefinition compilerDefinition : compilerDefinitions) {
|
||||
String compilerId = compilerDefinition.getId();
|
||||
String name;
|
||||
var languagePlugin = LanguagePlugin.getInstance();
|
||||
var compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
var compilerDefinitions = compilerRegistry.getCompilerDefinitions(language);
|
||||
|
||||
for (Hardware hardware : Hardware.values()) {
|
||||
if (hardware.equals(Hardware.GENERIC)) {
|
||||
continue;
|
||||
}
|
||||
setDefault(language, LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware),
|
||||
compilerDefinition.getSupportedTargets().get(0).toString());
|
||||
for (Hardware hardware : Hardware.values()) {
|
||||
if (hardware.equals(Hardware.GENERIC)) {
|
||||
continue;
|
||||
}
|
||||
for (var compilerDefinition : compilerDefinitions) {
|
||||
|
||||
name = LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware);
|
||||
setDefault(language, name, compilerDefinition.getDefaultParameters());
|
||||
name = LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware);
|
||||
setDefault(language, name, CompilerOutputFolderMode.TEMP_FOLDER);
|
||||
name = LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware);
|
||||
setDefault(language, name, HardwareUtility.getDefaultFileExtension(hardware));
|
||||
name = LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware);
|
||||
setDefault(language, name, RunnerId.DEFAULT_APPLICATION);
|
||||
setDefault(LanguageHardwareCompilerDefinitionPreferencesConstants.getCompilerTargetName(language,
|
||||
hardware, compilerDefinition), compilerDefinition.getSupportedTargets().get(0).toString());
|
||||
|
||||
var preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
|
||||
.getCompilerParametersName(language, hardware, compilerDefinition);
|
||||
setDefault(preferencesKey, compilerDefinition.getDefaultParameters());
|
||||
preferencesKey = LanguageHardwareCompilerDefinitionPreferencesConstants
|
||||
.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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ import com.wudsn.ide.lng.compiler.CompilerRegistry;
|
||||
import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase;
|
||||
import com.wudsn.ide.lng.editor.LanguageEditor;
|
||||
import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants.EditorConstants;
|
||||
|
||||
/**
|
||||
* Visual editor page for the language preferences.
|
||||
@ -358,8 +359,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
|
||||
if (textAttributeListItems != null) {
|
||||
throw new IllegalStateException("Attribute 'textAttributeListItems' must be null.");
|
||||
}
|
||||
List<TextAttributeDefinition> textAttributeDefinitions = LanguagePreferencesConstants
|
||||
.getTextAttributeDefinitions(language);
|
||||
List<TextAttributeDefinition> textAttributeDefinitions = EditorConstants.getTextAttributeDefinitions(language);
|
||||
textAttributeListItems = new ArrayList<TextAttributeListItem>(textAttributeDefinitions.size());
|
||||
|
||||
for (TextAttributeDefinition textAttributeDefinition : textAttributeDefinitions) {
|
||||
@ -394,7 +394,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
|
||||
};
|
||||
|
||||
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);
|
||||
addField(choiceFieldEditor);
|
||||
|
||||
@ -410,7 +410,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
|
||||
};
|
||||
|
||||
choiceFieldEditor = new RadioGroupFieldEditor(
|
||||
LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
EditorConstants.getEditorCompileCommandPositioningModeKey(language),
|
||||
Texts.PREFERENCES_COMPILE_COMMAND_POSITIONING_MODE_LABEL, 2, labelsAndValues, space);
|
||||
addField(choiceFieldEditor);
|
||||
|
||||
@ -432,21 +432,16 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage
|
||||
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
|
||||
tabItem.setText(compilerDefinition.getName());
|
||||
|
||||
Composite tabContent;
|
||||
tabContent = SWTFactory.createComposite(tabFolder, 1, 1, GridData.FILL_HORIZONTAL);
|
||||
var tabContent = SWTFactory.createComposite(tabFolder, 1, 1, GridData.FILL_HORIZONTAL);
|
||||
tabItem.setControl(tabContent);
|
||||
|
||||
Composite composite;
|
||||
|
||||
String name;
|
||||
name = LanguagePreferencesConstants.getPreferencesKey(language,
|
||||
LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId));
|
||||
var name = LanguagePreferencesConstants.getCompilerExecutablePathKey(language, compilerDefinition);
|
||||
|
||||
// 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,
|
||||
Texts.PREFERENCES_COMPILER_EXECUTABLE_PATH_LABEL, composite);
|
||||
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(language, compilerId);
|
||||
CompilerPath compilerPath = compilerPaths.getDefaultCompilerPath(language, compilerDefinition);
|
||||
if (compilerPath != null) {
|
||||
File file = compilerPath.getAbsoluteFile();
|
||||
if (file != null) {
|
||||
|
@ -24,6 +24,7 @@ import org.eclipse.jface.text.TextAttribute;
|
||||
|
||||
import com.wudsn.ide.base.common.AbstractIDEPlugin;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
|
||||
/**
|
||||
* Facade class for typed access to the plugin preferences.
|
||||
@ -77,7 +78,9 @@ public final class LanguagesPreferences {
|
||||
if (preferencesKey == 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 {
|
||||
result = result.trim();
|
||||
}
|
||||
|
||||
log(preferencesKey, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -112,12 +115,28 @@ public final class LanguagesPreferences {
|
||||
* @return The text attribute, not <code>null</code>.
|
||||
*
|
||||
*/
|
||||
public TextAttribute getEditorTextAttribute(String preferencesKey) {
|
||||
TextAttribute getEditorTextAttribute(String preferencesKey) {
|
||||
if (preferencesKey == 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 });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user