mirror of
https://github.com/peterdell/wudsn-ide.git
synced 2024-06-13 11:29:37 +00:00
Generalize Assembler to Language
This commit is contained in:
parent
abdbb3234d
commit
0ff9167294
|
@ -1,10 +1,9 @@
|
|||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage.name=Test Compilers
|
||||
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestCompiler.name=TEST
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestEditor.name=TEST Editor
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestSourceFile.name=TEST Source File
|
||||
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestEditor.name=Test Editor
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage.name=Test Hardware Assemblers
|
||||
|
||||
com.wudsn.ide.asm.editor.test.TestSourceFile.name=Test Source File
|
||||
|
||||
com.wudsn.ide.asm.runner.test.runner1.name=First Application
|
||||
com.wudsn.ide.asm.runner.test.runner2.name=Second Application
|
||||
com.wudsn.ide.asm.runner.test.runner1.name=First Runner for Test Hardware
|
||||
com.wudsn.ide.asm.runner.test.runner2.name=Second Runner for Test Hardware
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage.name=Test Kompiler
|
||||
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestCompiler.name=TEST
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestEditor.name=TEST Editor
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestSourceFile.name=TEST Quell-Datei
|
||||
|
||||
com.wudsn.ide.lng.asm.compiler.test.TestEditor.name=Test Editor
|
||||
com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage.name=Test Hardware Assembler
|
||||
|
||||
com.wudsn.ide.asm.editor.test.TestSourceFile.name=Test Quell-Datei
|
||||
|
||||
com.wudsn.ide.asm.runner.test.runner1.name=Erste Anwendung
|
||||
com.wudsn.ide.asm.runner.test.runner2.name=Zweite Anwendung
|
||||
com.wudsn.ide.asm.runner.test.runner1.name=Erste Anwendung für Test Hardware
|
||||
com.wudsn.ide.asm.runner.test.runner2.name=Zweite Anwendung für Test Hardware
|
||||
|
|
|
@ -6,45 +6,10 @@
|
|||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage"
|
||||
id="com.wudsn.ide.asm.preferences.test.AssemblerPreferencesTestCompilersPage"
|
||||
name="%com.wudsn.ide.asm.preferences.test.AssemblerPreferencesTestCompilersPage.name">
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesTestCompilersPage.name">
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="com.wudsn.ide.lng.compilers">
|
||||
<compiler
|
||||
class="com.wudsn.ide.lng.asm.test.TestCompiler"
|
||||
defaultParameters="-o${outputFilePath} ${sourceFilePath}"
|
||||
defaultHardware="TEST"
|
||||
homePageURL="https://www.wudsn.com"
|
||||
id="test"
|
||||
name="%com.wudsn.ide.lng.asm.test.TestCompiler.name"
|
||||
version="none">
|
||||
<supportedTarget
|
||||
target="MOS6502">
|
||||
</supportedTarget>
|
||||
<supportedTarget
|
||||
target="MOS6502_ILLEGAL">
|
||||
</supportedTarget>
|
||||
</compiler>
|
||||
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.core.contenttype.contentTypes">
|
||||
<content-type base-type="com.wudsn.ide.asm.editor.AssemblerSourceFile"
|
||||
file-extensions="asm" id="com.wudsn.ide.asm.editor.test.TestSourceFile"
|
||||
name="%com.wudsn.ide.asm.editor.test.TestSourceFile.name" priority="normal">
|
||||
</content-type>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.editors">
|
||||
<editor class="com.wudsn.ide.lng.asm.compiler.test.TestEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="false" extensions="asm" icon="icons/editor-test-16x16.gif"
|
||||
id="com.wudsn.ide.lng.editor.test.TestEditor" name="%com.wudsn.ide.asm.editor.test.TestEditor.name">
|
||||
<contentTypeBinding contentTypeId="com.wudsn.ide.lng.editor.test.TestSourceFile">
|
||||
</contentTypeBinding>
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.wudsn.ide.lng.runners">
|
||||
<runner
|
||||
|
@ -60,5 +25,40 @@
|
|||
name="%com.wudsn.ide.asm.runner.test.runner2.name">
|
||||
</runner>
|
||||
</extension>
|
||||
<extension point="com.wudsn.ide.lng.compilers">
|
||||
<compiler
|
||||
class="com.wudsn.ide.lng.asm.compiler.test.TestCompiler"
|
||||
defaultParameters="-o${outputFilePath} ${sourceFilePath}"
|
||||
defaultHardware="TEST"
|
||||
homePageURL="https://www.wudsn.com"
|
||||
id="test"
|
||||
name="%com.wudsn.ide.lng.asm.compiler.test.TestCompiler.name"
|
||||
version="none">
|
||||
<supportedTarget
|
||||
target="MOS6502">
|
||||
</supportedTarget>
|
||||
<supportedTarget
|
||||
target="MOS6502_ILLEGAL">
|
||||
</supportedTarget>
|
||||
</compiler>
|
||||
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.core.contenttype.contentTypes">
|
||||
<content-type base-type="com.wudsn.ide.lng.asm.compiler.AssemblerSourceFile"
|
||||
file-extensions="asm" id="com.wudsn.ide.lng.asm.compiler.test.TestSourceFile"
|
||||
name="%com.wudsn.ide.lng.asm.compiler.test.TestSourceFile.name" priority="normal">
|
||||
</content-type>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.editors">
|
||||
<editor class="com.wudsn.ide.lng.asm.compiler.test.TestEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="false" extensions="asm" icon="icons/editor-test-16x16.gif"
|
||||
id="com.wudsn.ide.lng.asm.compiler.test.TestEditor" name="%com.wudsn.ide.lng.asm.compiler.test.TestEditor.name">
|
||||
<contentTypeBinding contentTypeId="com.wudsn.ide.lng.editor.test.TestSourceFile">
|
||||
</contentTypeBinding>
|
||||
</editor>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
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
|
||||
|
@ -5,7 +8,6 @@ com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesAtari8CompilersPage.name=A
|
|||
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.compiler.acme.AcmeCompiler.name=ACME
|
||||
com.wudsn.ide.lng.asm.compiler.acme.AcmeEditor.name=ACME Editor
|
||||
com.wudsn.ide.lng.asm.compiler.acme.AcmeSourceFile.name=ACME Source File
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
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
|
||||
|
|
|
@ -1,40 +1,50 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.LanguagesPreferencesPage"
|
||||
class="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
id="com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.asm.preferences.AssemblerPreferencesPage.name">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
</page>
|
||||
<page
|
||||
category="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
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">
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.core.resources.IMarker;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
import com.wudsn.ide.base.common.FileUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerProcessLogParser;
|
||||
import com.wudsn.ide.lng.compiler.CompilerSymbol;
|
||||
import com.wudsn.ide.lng.compiler.CompilerSymbolType;
|
||||
|
@ -214,7 +214,7 @@ final class MadsCompilerProcessLogParser extends CompilerProcessLogParser {
|
|||
value);
|
||||
compilerSymbols.add(compilerSymbol);
|
||||
} catch (NumberFormatException ex) {
|
||||
AssemblerPlugin.getInstance().logError("Cannot parse value {1} of symbol {0}.",
|
||||
LanguagePlugin.getInstance().logError("Cannot parse value {1} of symbol {0}.",
|
||||
new Object[] { name, valueString }, ex);
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ final class Merlin32CompilerProcessLogParser extends CompilerProcessLogParser {
|
|||
// value);
|
||||
// compilerSymbols.add(compilerSymbol);
|
||||
// } catch (NumberFormatException ex) {
|
||||
// AssemblerPlugin.getInstance().logError("Cannot parse value {1} of symbol
|
||||
// LanguagePlugin.getInstance().logError("Cannot parse value {1} of symbol
|
||||
// {0}.",
|
||||
// new Object[] { name, valueString }, ex);
|
||||
// }
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class AssemblerPreferencesNESCompilersPage extends LanguagePreferen
|
|||
* Create is public. Used by extension point "org.eclipse.ui.preferencePages".
|
||||
*/
|
||||
public AssemblerPreferencesNESCompilersPage() {
|
||||
super(Language.ASM,Hardware.NES);
|
||||
super(Language.ASM, Hardware.NES);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* 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.lng.Language;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesPage;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPreferencesPage extends LanguagePreferencesPage {
|
||||
|
||||
public AssemblerPreferencesPage() {
|
||||
super(Language.ASM);
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: WUDSN IDE Language Plug-in
|
||||
Bundle-SymbolicName: com.wudsn.ide.lng;singleton:=true
|
||||
Bundle-Version: 1.7.2.qualifier
|
||||
Bundle-Activator: com.wudsn.ide.lng.AssemblerPlugin
|
||||
Bundle-Activator: com.wudsn.ide.lng.LanguagePlugin
|
||||
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
|
||||
org.eclipse.core.resources;visibility:=reexport,
|
||||
org.eclipse.core.filesystem,
|
||||
|
|
|
@ -45,8 +45,8 @@ com.wudsn.ide.lng.editor.AssemblerBreakpoint.name=Breakpoint
|
|||
com.wudsn.ide.lng.editor.CompilerSymbolsView.name=Symbols
|
||||
|
||||
# Preferences
|
||||
com.wudsn.ide.lng.preferences.AssemblerPreferences.name=Assembler Preferences
|
||||
com.wudsn.ide.lng.preferences.AssemblerPreferencesPage.name=Assembler
|
||||
com.wudsn.ide.lng.preferences.LanguagesPreferences.name=Languages Preferences
|
||||
com.wudsn.ide.lng.preferences.LanguagesPreferencesPage.name=Languages
|
||||
|
||||
com.wudsn.ide.lng.runner.DefaultApplication.name=Operating System Default Application
|
||||
com.wudsn.ide.lng.runner.UserDefinedApplication.name=User Defined Application
|
||||
|
|
|
@ -45,8 +45,8 @@ com.wudsn.ide.lng.editor.AssemblerBreakpoint.name=Unterbrechungspunkt
|
|||
com.wudsn.ide.lng.editor.CompilerSymbolsView.name=Symbole
|
||||
|
||||
# Preferences
|
||||
com.wudsn.ide.lng.preferences.AssemblerPreferences.name=Assembler Einstellungen
|
||||
com.wudsn.ide.lng.preferences.AssemblerPreferencesPage.name=Assembler
|
||||
com.wudsn.ide.lng.preferences.LanguagesPreferences.name=Sprachen Einstellungen
|
||||
com.wudsn.ide.lng.preferences.LanguagesPreferencesPage.name=Sprachen
|
||||
|
||||
com.wudsn.ide.lng.runner.DefaultApplication.name=Standardanwendung des Betriebssystems
|
||||
com.wudsn.ide.lng.runner.UserDefinedApplication.name=Benutzerdefinierte Anwendung
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<extension
|
||||
point="org.eclipse.core.runtime.preferences">
|
||||
<initializer
|
||||
class="com.wudsn.ide.lng.preferences.AssemblerPreferencesInitializer">
|
||||
class="com.wudsn.ide.lng.preferences.LanguagePreferencesInitializer">
|
||||
</initializer>
|
||||
</extension>
|
||||
<extension
|
||||
|
@ -24,10 +24,11 @@
|
|||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
class="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
id="com.wudsn.ide.lng.preferences.AssemblerPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.preferences.AssemblerPreferencesPage.name"/>
|
||||
class="com.wudsn.ide.lng.preferences.LanguagesPreferencesPage"
|
||||
id="com.wudsn.ide.lng.preferences.LanguagesPreferencesPage"
|
||||
name="%com.wudsn.ide.lng.preferences.LanguagesPreferencesPage.name"/>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
|
||||
<hyperlinkDetector
|
||||
|
@ -397,8 +398,8 @@
|
|||
point="org.eclipse.ui.preferenceTransfer">
|
||||
<transfer
|
||||
icon="icons/hardware-generic-16x16.gif"
|
||||
id="com.wudsn.ide.lng.preferences.AssemblerPreferences"
|
||||
name="%com.wudsn.ide.lng.preferences.AssemblerPreferences.name">
|
||||
id="com.wudsn.ide.lng.preferences.LanguagePreferences"
|
||||
name="%com.wudsn.ide.lng.preferences.LanguagePreferences.name">
|
||||
<mapping
|
||||
scope="instance">
|
||||
<entry
|
||||
|
|
|
@ -34,9 +34,9 @@ import org.osgi.framework.BundleContext;
|
|||
import com.wudsn.ide.base.common.AbstractIDEPlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerConsole;
|
||||
import com.wudsn.ide.lng.compiler.CompilerRegistry;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferencesChangeListener;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferencesConstants;
|
||||
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.runner.RunnerRegistry;
|
||||
|
||||
/**
|
||||
|
@ -44,7 +44,7 @@ import com.wudsn.ide.lng.runner.RunnerRegistry;
|
|||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPlugin extends AbstractIDEPlugin {
|
||||
public final class LanguagePlugin extends AbstractIDEPlugin {
|
||||
|
||||
/**
|
||||
* The plugin id.
|
||||
|
@ -54,13 +54,13 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
/**
|
||||
* The shared instance.
|
||||
*/
|
||||
private static AssemblerPlugin plugin;
|
||||
private static LanguagePlugin plugin;
|
||||
|
||||
/**
|
||||
* The preferences.
|
||||
*/
|
||||
private AssemblerPreferences preferences;
|
||||
private ListenerList<AssemblerPreferencesChangeListener> preferencesChangeListeners;
|
||||
private LanguagePreferences preferences;
|
||||
private ListenerList<LanguagePreferencesChangeListener> preferencesChangeListeners;
|
||||
|
||||
/**
|
||||
* The compiler registry.
|
||||
|
@ -85,9 +85,9 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
/**
|
||||
* Creates a new instance. Must be public for dynamic instantiation.
|
||||
*/
|
||||
public AssemblerPlugin() {
|
||||
public LanguagePlugin() {
|
||||
preferences = null;
|
||||
preferencesChangeListeners = new ListenerList<AssemblerPreferencesChangeListener>(ListenerList.IDENTITY);
|
||||
preferencesChangeListeners = new ListenerList<LanguagePreferencesChangeListener>(ListenerList.IDENTITY);
|
||||
compilerRegistry = new CompilerRegistry();
|
||||
compilerConsole = null;
|
||||
runnerRegistry = new RunnerRegistry();
|
||||
|
@ -108,7 +108,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
preferences = new AssemblerPreferences(getPreferenceStore());
|
||||
preferences = new LanguagePreferences(getPreferenceStore());
|
||||
plugin = this;
|
||||
try {
|
||||
compilerRegistry.init();
|
||||
|
@ -132,7 +132,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (event.getProperty().equals(JFaceResources.TEXT_FONT)
|
||||
|| event.getProperty().equals(BLOCK_SELECTION_MODE_FONT)) {
|
||||
firePreferencesChangeEvent(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTES);
|
||||
firePreferencesChangeEvent(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTES);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
*
|
||||
* @return The plug-in, not <code>null</code>.
|
||||
*/
|
||||
public static AssemblerPlugin getInstance() {
|
||||
public static LanguagePlugin getInstance() {
|
||||
if (plugin == null) {
|
||||
throw new IllegalStateException("Plugin not initialized or already stopped");
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
*
|
||||
* @return The preferences, not <code>null</code>.
|
||||
*/
|
||||
public AssemblerPreferences getPreferences() {
|
||||
public LanguagePreferences getPreferences() {
|
||||
if (preferences == null) {
|
||||
throw new IllegalStateException("Field 'preferences' must not be null.");
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
* @param listener The listener, not <code>null</code>.
|
||||
* @since 1.6.3
|
||||
*/
|
||||
public void addPreferencesChangeListener(AssemblerPreferencesChangeListener listener) {
|
||||
public void addPreferencesChangeListener(LanguagePreferencesChangeListener listener) {
|
||||
if (listener == null) {
|
||||
throw new IllegalArgumentException("Parameter 'listener' must not be null.");
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
* @param listener The listener, not <code>null</code>.
|
||||
* @since 1.6.3
|
||||
*/
|
||||
public void removePreferencesChangeListener(AssemblerPreferencesChangeListener listener) {
|
||||
public void removePreferencesChangeListener(LanguagePreferencesChangeListener listener) {
|
||||
if (listener == null) {
|
||||
throw new IllegalArgumentException("Parameter 'listener' must not be null.");
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ public final class AssemblerPlugin extends AbstractIDEPlugin {
|
|||
if (!changedPropertyNames.isEmpty()) {
|
||||
|
||||
for (Object listener : preferencesChangeListeners.getListeners()) {
|
||||
((AssemblerPreferencesChangeListener) listener).preferencesChanged(preferences, changedPropertyNames);
|
||||
((LanguagePreferencesChangeListener) listener).preferencesChanged(preferences, changedPropertyNames);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ import com.wudsn.ide.base.common.FileUtility;
|
|||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.syntax.CompilerSyntax;
|
||||
|
@ -56,7 +56,7 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||
private String homePageURL;
|
||||
|
||||
// Editing and source parsing.
|
||||
private List<Target> supportedCPUs;
|
||||
private List<Target> supportedTargets;
|
||||
private CompilerSyntax syntax;
|
||||
|
||||
// Compiling.
|
||||
|
@ -245,12 +245,12 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||
// displayed because the path to the compiler executable
|
||||
// is not set in the preferences.
|
||||
throw new CoreException(
|
||||
new Status(IStatus.ERROR, AssemblerPlugin.ID, TextUtility.format(Texts.MESSAGE_E130, name)));
|
||||
new Status(IStatus.ERROR, LanguagePlugin.ID, TextUtility.format(Texts.MESSAGE_E130, name)));
|
||||
}
|
||||
if (!hasHelpFile()) {
|
||||
// ERROR: The compiler '{0}' does not specify a help file path.
|
||||
throw new CoreException(
|
||||
new Status(IStatus.ERROR, AssemblerPlugin.ID, TextUtility.format(Texts.MESSAGE_E102, name)));
|
||||
new Status(IStatus.ERROR, LanguagePlugin.ID, TextUtility.format(Texts.MESSAGE_E102, name)));
|
||||
}
|
||||
|
||||
String localeLanguage = Locale.getDefault().getLanguage();
|
||||
|
@ -285,7 +285,7 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||
// ERROR: Help for the '{0}' compiler cannot be displayed because no
|
||||
// help file was found in the paths '{1}' for the compiler
|
||||
// executable path '{0}'.
|
||||
throw new CoreException(new Status(IStatus.ERROR, AssemblerPlugin.ID,
|
||||
throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID,
|
||||
TextUtility.format(Texts.MESSAGE_E131, name, helpFilePaths, compilerExecutablePath)));
|
||||
}
|
||||
return result;
|
||||
|
@ -293,20 +293,20 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the list of supported CPUs Called by {@link CompilerRegistry} only.
|
||||
* Sets the list of supported targets. Called by {@link CompilerRegistry} only.
|
||||
*
|
||||
* @param supportedCPUs The unmodifiable list of supported CPUs, not empty and
|
||||
* @param supportedTargets The unmodifiable list of supported CPUs, not empty and
|
||||
* not <code>null</code>.
|
||||
* @since 1.6.1
|
||||
*/
|
||||
final void setSupportedCPUs(List<Target> supportedCPUs) {
|
||||
if (supportedCPUs == null) {
|
||||
throw new IllegalArgumentException("Parameter 'supportedCPUs' must not be null.");
|
||||
final void setSupportedTargets(List<Target> supportedTargets) {
|
||||
if (supportedTargets == null) {
|
||||
throw new IllegalArgumentException("Parameter 'supportedTargets' must not be null.");
|
||||
}
|
||||
if (supportedCPUs.isEmpty()) {
|
||||
throw new IllegalArgumentException("Parameter 'supportedCPUs' must not be empty.");
|
||||
if (supportedTargets.isEmpty()) {
|
||||
throw new IllegalArgumentException("Parameter 'supportedTargets' must not be empty.");
|
||||
}
|
||||
this.supportedCPUs = supportedCPUs;
|
||||
this.supportedTargets = supportedTargets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,10 +319,10 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||
* @since 1.6.1
|
||||
*/
|
||||
public final List<Target> getSupportedTargets() {
|
||||
if (supportedCPUs == null) {
|
||||
if (supportedTargets == null) {
|
||||
throw new IllegalStateException("Field 'supportedCPUs' must not be null.");
|
||||
}
|
||||
return supportedCPUs;
|
||||
return supportedTargets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.eclipse.core.runtime.Path;
|
|||
|
||||
import com.wudsn.ide.base.common.NumberUtility;
|
||||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
|
||||
/**
|
||||
|
@ -250,7 +250,7 @@ public abstract class CompilerProcessLogParser {
|
|||
}
|
||||
}
|
||||
} catch (CoreException ex) {
|
||||
AssemblerPlugin.getInstance().logError("Could not retrieve members of {0}",
|
||||
LanguagePlugin.getInstance().logError("Could not retrieve members of {0}",
|
||||
new Object[] { iFile }, ex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,15 +99,14 @@ public final class CompilerRegistry {
|
|||
compilerDefinition.setHomePageURL(configurationElement.getAttribute("homePageURL"));
|
||||
compilerDefinition.setDefaultParameters(configurationElement.getAttribute("defaultParameters"));
|
||||
|
||||
configurationElement.getChildren("supportedCPU");
|
||||
IConfigurationElement[] supportedTargetsArray;
|
||||
supportedTargetsArray = configurationElement.getChildren("supportedCPU");
|
||||
supportedTargetsArray = configurationElement.getChildren("supportedTarget");
|
||||
List<Target> supportedTargets = new ArrayList<Target>(supportedTargetsArray.length);
|
||||
for (IConfigurationElement supportedCPU : supportedTargetsArray) {
|
||||
supportedTargets.add(Target.valueOf(supportedCPU.getAttribute("target")));
|
||||
for (IConfigurationElement supportedTarget : supportedTargetsArray) {
|
||||
supportedTargets.add(Target.valueOf(supportedTarget.getAttribute("target")));
|
||||
}
|
||||
supportedTargets = Collections.unmodifiableList(supportedTargets);
|
||||
compilerDefinition.setSupportedCPUs(supportedTargets);
|
||||
compilerDefinition.setSupportedTargets(supportedTargets);
|
||||
compilerDefinition
|
||||
.setDefaultHardware(Hardware.valueOf(configurationElement.getAttribute("defaultHardware")));
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jface.text.IRegion;
|
|||
import com.wudsn.ide.base.BasePlugin;
|
||||
import com.wudsn.ide.base.common.FileUtility;
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.AssemblerProperties;
|
||||
import com.wudsn.ide.lng.compiler.Compiler;
|
||||
import com.wudsn.ide.lng.compiler.syntax.CompilerSyntax;
|
||||
|
@ -967,7 +967,7 @@ public abstract class CompilerSourceParser {
|
|||
section.addChild(newChild);
|
||||
}
|
||||
} else {
|
||||
AssemblerPlugin.getInstance().log("Include file '{0}' was already parsed. Stopping recursion.",
|
||||
LanguagePlugin.getInstance().log("Include file '{0}' was already parsed. Stopping recursion.",
|
||||
new Object[] { newSourceFile.getDocumentFile().getPath() });
|
||||
}
|
||||
endSection(endOffset);
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.eclipse.ui.IEditorInput;
|
|||
|
||||
import com.wudsn.ide.base.common.NumberUtility;
|
||||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ public final class AssemblerBreakpoint extends LineBreakpoint {
|
|||
/**
|
||||
* Grouping ID for all breakpoint of this type.
|
||||
*/
|
||||
public static final String DEBUG_MODEL_ID = AssemblerPlugin.ID;
|
||||
public static final String DEBUG_MODEL_ID = LanguagePlugin.ID;
|
||||
|
||||
/**
|
||||
* Marker type as defined by the extension "org.eclipse.core.resources.markers"
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.eclipse.swt.graphics.Image;
|
|||
import org.eclipse.swt.graphics.TextStyle;
|
||||
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerFiles;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceFile;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParser;
|
||||
|
@ -50,7 +50,7 @@ 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.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
|
||||
/**
|
||||
* Class for content assist. Creates the content assist list.
|
||||
|
@ -171,7 +171,7 @@ final class AssemblerContentAssistProcessor implements IContentAssistProcessor {
|
|||
|
||||
this.editor = editor;
|
||||
|
||||
AssemblerPlugin plugin = editor.getPlugin();
|
||||
LanguagePlugin plugin = editor.getPlugin();
|
||||
directiveImage = plugin.getImage("instruction-type-directive-16x16.gif");
|
||||
legalOpcodeImage = plugin.getImage("instruction-type-legal-opcode-16x16.gif");
|
||||
illegalOpcodeImage = plugin.getImage("instruction-type-illegal-opcode-16x16.gif");
|
||||
|
@ -304,7 +304,7 @@ final class AssemblerContentAssistProcessor implements IContentAssistProcessor {
|
|||
if (proposalList == null) {
|
||||
throw new IllegalArgumentException("Parameter 'proposalList' must not be null.");
|
||||
}
|
||||
AssemblerPreferences assemblerPreferences = editor.getPlugin().getPreferences();
|
||||
LanguagePreferences languagePreferences = editor.getPlugin().getPreferences();
|
||||
|
||||
int offset = region.getOffset();
|
||||
boolean lowerCase;
|
||||
|
@ -313,7 +313,7 @@ final class AssemblerContentAssistProcessor implements IContentAssistProcessor {
|
|||
// example "."
|
||||
if (StringUtility.isEmpty(prefix) || !Character.isLetter(prefix.charAt(prefix.length() - 1))) {
|
||||
String defaultCase;
|
||||
defaultCase = assemblerPreferences.getEditorContentAssistProcessorDefaultCase();
|
||||
defaultCase = languagePreferences.getEditorContentAssistProcessorDefaultCase();
|
||||
lowerCase = AssemblerContentAssistProcessorDefaultCase.LOWER_CASE.equals(defaultCase);
|
||||
} else {
|
||||
char lastchar = prefix.charAt(prefix.length() - 1);
|
||||
|
|
|
@ -51,7 +51,7 @@ import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
|
|||
|
||||
import com.wudsn.ide.base.common.Profiler;
|
||||
import com.wudsn.ide.base.common.RunnableWithLogging;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceFile;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObject;
|
||||
|
@ -93,7 +93,7 @@ final class AssemblerContentOutlinePage extends ContentOutlinePage {
|
|||
throw new IllegalArgumentException("Parameter 'treeViewer' must not be null.");
|
||||
}
|
||||
setToolTipText(Texts.ASSEMBLER_CONTENT_OUTLINE_SORT_BUTTON_TOOL_TIP);
|
||||
ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(AssemblerPlugin.ID,
|
||||
ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(LanguagePlugin.ID,
|
||||
"icons/outline-sort.gif");
|
||||
setImageDescriptor(imageDescriptor);
|
||||
this.editor = editor;
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
|
|||
|
||||
import com.wudsn.ide.base.common.Profiler;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.AssemblerProperties;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.AssemblerProperties.InvalidAssemblerPropertyException;
|
||||
|
@ -75,7 +75,7 @@ import com.wudsn.ide.lng.preferences.CompilerPreferences;
|
|||
*/
|
||||
public abstract class AssemblerEditor extends TextEditor {
|
||||
|
||||
private AssemblerPlugin plugin;
|
||||
private LanguagePlugin plugin;
|
||||
private AssemblerEditorFilesLogic filesLogic;
|
||||
|
||||
private Compiler compiler;
|
||||
|
@ -128,7 +128,7 @@ public abstract class AssemblerEditor extends TextEditor {
|
|||
protected final void initializeEditor() {
|
||||
super.initializeEditor();
|
||||
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
compiler = plugin.getCompilerRegistry().getCompiler(getCompilerId());
|
||||
|
||||
setSourceViewerConfiguration(new AssemblerSourceViewerConfiguration(this, getPreferenceStore()));
|
||||
|
@ -140,7 +140,7 @@ public abstract class AssemblerEditor extends TextEditor {
|
|||
*
|
||||
* @return The plugin this compiler instance belongs to, not <code>null</code>.
|
||||
*/
|
||||
public final AssemblerPlugin getPlugin() {
|
||||
public final LanguagePlugin getPlugin() {
|
||||
if (plugin == null) {
|
||||
throw new IllegalStateException("Field 'plugin' must not be null.");
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ public abstract class AssemblerEditor extends TextEditor {
|
|||
* content.
|
||||
*
|
||||
* Called by {@link #updateIdentifiers(CompilerSourceFile)} and
|
||||
* {@link AssemblerSourceViewerConfiguration#preferencesChanged(com.wudsn.ide.lng.preferences.AssemblerPreferences, java.util.Set)}
|
||||
* {@link AssemblerSourceViewerConfiguration#preferencesChanged(com.wudsn.ide.lng.preferences.LanguagePreferences, java.util.Set)}
|
||||
* .
|
||||
*/
|
||||
final void refreshSourceViewer() {
|
||||
|
|
|
@ -57,7 +57,7 @@ import com.wudsn.ide.base.common.NumberUtility;
|
|||
import com.wudsn.ide.base.common.ProcessWithLogs;
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.HardwareUtility;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.Compiler;
|
||||
|
@ -91,13 +91,13 @@ final class AssemblerEditorCompileCommand {
|
|||
/**
|
||||
* The owning plugin.
|
||||
*/
|
||||
private AssemblerPlugin plugin;
|
||||
private LanguagePlugin plugin;
|
||||
|
||||
/**
|
||||
* Creation is private.
|
||||
*/
|
||||
private AssemblerEditorCompileCommand() {
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -769,7 +769,7 @@ final class AssemblerEditorCompileCommand {
|
|||
message = ex.getClass().getName();
|
||||
}
|
||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, message);
|
||||
AssemblerPlugin.getInstance().logError("Error in addCompilerSymbols()", null, ex);
|
||||
LanguagePlugin.getInstance().logError("Error in addCompilerSymbols()", null, ex);
|
||||
|
||||
} catch (CoreException ex) {
|
||||
String message = ex.getMessage();
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
|
|||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.base.hardware.HardwareUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.preferences.CompilerPreferences;
|
||||
import com.wudsn.ide.lng.runner.RunnerDefinition;
|
||||
|
@ -106,8 +106,8 @@ public final class AssemblerEditorCompileCommandDelegate
|
|||
return null;
|
||||
}
|
||||
|
||||
AssemblerPlugin assemblerPlugin = assemblerEditor.getPlugin();
|
||||
RunnerRegistry runnerRegistry = assemblerPlugin.getRunnerRegistry();
|
||||
LanguagePlugin languagePlugin = assemblerEditor.getPlugin();
|
||||
RunnerRegistry runnerRegistry = languagePlugin.getRunnerRegistry();
|
||||
Hardware hardware = assemblerEditor.getHardware();
|
||||
List<RunnerDefinition> runnerDefinitions = runnerRegistry.getDefinitions(hardware);
|
||||
CompilerPreferences compilerPreferences = assemblerEditor.getCompilerPreferences();
|
||||
|
@ -179,7 +179,7 @@ public final class AssemblerEditorCompileCommandDelegate
|
|||
try {
|
||||
compileAndRun(null);
|
||||
} catch (RuntimeException ex) {
|
||||
AssemblerPlugin.getInstance().showError(window.getShell(), "Error in compileAndRun()", ex);
|
||||
LanguagePlugin.getInstance().showError(window.getShell(), "Error in compileAndRun()", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
|
||||
/**
|
||||
* Event handler for the "Compiler Help" command.
|
||||
|
@ -57,8 +57,8 @@ public final class AssemblerEditorCompilerHelpCommandHandler extends AbstractHan
|
|||
assemblerEditor = (AssemblerEditor) editor;
|
||||
|
||||
CompilerDefinition compilerDefinition = assemblerEditor.getCompilerDefinition();
|
||||
AssemblerPreferences assemblerPreferences = AssemblerPlugin.getInstance().getPreferences();
|
||||
String compilerExecutablePath = assemblerPreferences.getCompilerExecutablePath(compilerDefinition.getId());
|
||||
LanguagePreferences languagePreferences = LanguagePlugin.getInstance().getPreferences();
|
||||
String compilerExecutablePath = languagePreferences.getCompilerExecutablePath(compilerDefinition.getId());
|
||||
|
||||
try {
|
||||
File file = compilerDefinition.getHelpFile(compilerExecutablePath);
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.core.commands.common.NotDefinedException;
|
|||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerFiles;
|
||||
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ public abstract class AssemblerEditorFilesCommandHandler extends AbstractHandler
|
|||
execute(event, assemblerEditor, files);
|
||||
} else {
|
||||
try {
|
||||
AssemblerPlugin.getInstance().showError(assemblerEditor.getSite().getShell(),
|
||||
LanguagePlugin.getInstance().showError(assemblerEditor.getSite().getShell(),
|
||||
"Operation '" + event.getCommand().getName()
|
||||
+ "' is not possible because the file in the editor is not located in the workspace.",
|
||||
new Exception("Cannot resolve compiler files of " + assemblerEditor.getEditorInput()));
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.wudsn.ide.base.common.FileUtility;
|
|||
import com.wudsn.ide.base.common.MarkerUtility;
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.AssemblerProperties;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.AssemblerProperties.AssemblerProperty;
|
||||
|
@ -110,7 +110,7 @@ public final class AssemblerEditorFilesLogic {
|
|||
document = new Document(mainSource);
|
||||
mainSourceFileProperties = CompilerSourceParser.getDocumentProperties(document);
|
||||
} catch (CoreException ex) {
|
||||
AssemblerPlugin plugin = AssemblerPlugin.getInstance();
|
||||
LanguagePlugin plugin = LanguagePlugin.getInstance();
|
||||
|
||||
plugin.logError("Cannot read main source file '{0'}", new Object[] { mainSourceFile.getPath() },
|
||||
ex);
|
||||
|
@ -203,7 +203,7 @@ public final class AssemblerEditorFilesLogic {
|
|||
try {
|
||||
iFile.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ZERO);
|
||||
} catch (CoreException ex) {
|
||||
AssemblerPlugin.getInstance().logError("Cannot remove markers", null, ex);
|
||||
LanguagePlugin.getInstance().logError("Cannot remove markers", null, ex);
|
||||
}
|
||||
// ERROR: Hardware not specified. Specify one of the
|
||||
// following valid values '{0}'.
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.eclipse.jface.text.source.SourceViewer;
|
|||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.ui.texteditor.TextEditorAction;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
|
||||
/**
|
||||
* Action to toggle a comment.
|
||||
|
@ -123,7 +123,7 @@ final class AssemblerEditorToggleCommentAction extends TextEditorAction {
|
|||
}
|
||||
}
|
||||
} catch (BadLocationException ex) {
|
||||
AssemblerPlugin.getInstance().logError("Cannot find location", null, ex);
|
||||
LanguagePlugin.getInstance().logError("Cannot find location", null, ex);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.eclipse.ui.ide.IDE;
|
|||
import com.wudsn.ide.base.common.FileUtility;
|
||||
import com.wudsn.ide.base.common.StringUtility;
|
||||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ final class AssemblerHyperlink implements IHyperlink {
|
|||
editorPart = IDE.openEditorOnFileStore(workbenchPage, fileStore);
|
||||
} catch (PartInitException ex) {
|
||||
|
||||
AssemblerPlugin.getInstance().logError("Cannot default editor editor for '{0}'.",
|
||||
LanguagePlugin.getInstance().logError("Cannot default editor editor for '{0}'.",
|
||||
new Object[] { uri }, ex);
|
||||
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ final class AssemblerHyperlink implements IHyperlink {
|
|||
|
||||
editorPart = IDE.openEditor(workbenchPage, uri, editorId, true);
|
||||
} catch (PartInitException ex) {
|
||||
AssemblerPlugin.getInstance().logError("Cannot system editor editor for '{0}'.",
|
||||
LanguagePlugin.getInstance().logError("Cannot system editor editor for '{0}'.",
|
||||
new Object[] { uri }, ex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.eclipse.jface.text.TextAttribute;
|
|||
import org.eclipse.jface.text.rules.RuleBasedScanner;
|
||||
import org.eclipse.jface.text.rules.Token;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
import com.wudsn.ide.lng.preferences.TextAttributeConverter;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ final class AssemblerRuleBasedScanner extends RuleBasedScanner {
|
|||
|
||||
this.preferencesKey = preferencesKey;
|
||||
|
||||
AssemblerPreferences preferences = AssemblerPlugin.getInstance().getPreferences();
|
||||
LanguagePreferences preferences = LanguagePlugin.getInstance().getPreferences();
|
||||
defaultToken = new Token(preferences.getEditorTextAttribute(preferencesKey));
|
||||
|
||||
super.setDefaultReturnToken(defaultToken);
|
||||
|
@ -80,7 +80,7 @@ final class AssemblerRuleBasedScanner extends RuleBasedScanner {
|
|||
*
|
||||
* @return <code>true</code> If the editor has to be refreshed.
|
||||
*/
|
||||
final boolean preferencesChanged(AssemblerPreferences preferences, Set<String> changedPropertyNames) {
|
||||
final boolean preferencesChanged(LanguagePreferences preferences, Set<String> changedPropertyNames) {
|
||||
if (preferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferences' must not be null.");
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ 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.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferencesConstants;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants;
|
||||
import com.wudsn.ide.lng.preferences.TextAttributeConverter;
|
||||
|
||||
/**
|
||||
|
@ -396,27 +396,27 @@ final class AssemblerSourceScanner extends RuleBasedScanner {
|
|||
private void createTokens() {
|
||||
|
||||
// Numbers
|
||||
numberToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER);
|
||||
numberToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER);
|
||||
|
||||
// Instructions
|
||||
directiveToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE);
|
||||
legalOpcodeToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL);
|
||||
illegalOpcodeToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL);
|
||||
pseudoOpcodeToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO);
|
||||
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);
|
||||
|
||||
// Identifiers
|
||||
equateIdentifierToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE);
|
||||
labelIdentifierToken = createToken(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL);
|
||||
equateIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE);
|
||||
labelIdentifierToken = createToken(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL);
|
||||
enumDefinitionSectionIdentifierToken = createToken(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION);
|
||||
structureDefinitionSectionIdentifierToken = createToken(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION);
|
||||
localSectionIdentifierToken = createToken(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION);
|
||||
macroDefinitionSectionIdentifierToken = createToken(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION);
|
||||
procedureDefinitionSectionIdentifierToken = createToken(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION);
|
||||
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ final class AssemblerSourceScanner extends RuleBasedScanner {
|
|||
if (textAttributeName == null) {
|
||||
throw new IllegalArgumentException("Parameter 'textAttributeName' must not be null.");
|
||||
}
|
||||
AssemblerPreferences preferences;
|
||||
LanguagePreferences preferences;
|
||||
Token token;
|
||||
preferences = editor.getPlugin().getPreferences();
|
||||
token = new Token(preferences.getEditorTextAttribute(textAttributeName));
|
||||
|
@ -486,7 +486,7 @@ final class AssemblerSourceScanner extends RuleBasedScanner {
|
|||
*
|
||||
* @return <code>true</code> If the editor has to be refreshed.
|
||||
*/
|
||||
final boolean preferencesChanged(AssemblerPreferences preferences, Set<String> changedPropertyNames) {
|
||||
final boolean preferencesChanged(LanguagePreferences preferences, Set<String> changedPropertyNames) {
|
||||
if (preferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferences' must not be null.");
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ final class AssemblerSourceScanner extends RuleBasedScanner {
|
|||
token.setData(preferences.getEditorTextAttribute(propertyName));
|
||||
refresh = true;
|
||||
|
||||
} else if (AssemblerPreferencesConstants.isCompilerTargetName(propertyName)) {
|
||||
} else if (LanguagePreferencesConstants.isCompilerTargetName(propertyName)) {
|
||||
CompilerSourceParser compilerSourceParser = editor.createCompilerSourceParser();
|
||||
wordRule.setCompilerSourceParser(compilerSourceParser);
|
||||
wordRule.setInstructions();
|
||||
|
|
|
@ -38,9 +38,9 @@ import org.eclipse.jface.text.source.ISourceViewer;
|
|||
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
|
||||
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferencesChangeListener;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferencesConstants;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesChangeListener;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferencesConstants;
|
||||
|
||||
/**
|
||||
* Source configuration for the assembler editor. Provides syntax highlighting.
|
||||
|
@ -51,7 +51,7 @@ import com.wudsn.ide.lng.preferences.AssemblerPreferencesConstants;
|
|||
* @author Andy Reek
|
||||
*/
|
||||
final class AssemblerSourceViewerConfiguration extends TextSourceViewerConfiguration
|
||||
implements AssemblerPreferencesChangeListener {
|
||||
implements LanguagePreferencesChangeListener {
|
||||
|
||||
/**
|
||||
* The underlying assembler editor.
|
||||
|
@ -134,7 +134,7 @@ final class AssemblerSourceViewerConfiguration extends TextSourceViewerConfigura
|
|||
}
|
||||
|
||||
@Override
|
||||
public void preferencesChanged(AssemblerPreferences preferences, Set<String> changedPropertyNames) {
|
||||
public void preferencesChanged(LanguagePreferences preferences, Set<String> changedPropertyNames) {
|
||||
if (preferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferences' must not be null.");
|
||||
}
|
||||
|
@ -174,18 +174,18 @@ final class AssemblerSourceViewerConfiguration extends TextSourceViewerConfigura
|
|||
DefaultDamagerRepairer dr;
|
||||
|
||||
commentSingleScanner = new AssemblerRuleBasedScanner(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
dr = new DefaultDamagerRepairer(commentSingleScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE);
|
||||
|
||||
commentMultipleScanner = new AssemblerRuleBasedScanner(
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT);
|
||||
dr = new DefaultDamagerRepairer(commentMultipleScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE);
|
||||
|
||||
stringScanner = new AssemblerRuleBasedScanner(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING);
|
||||
stringScanner = new AssemblerRuleBasedScanner(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING);
|
||||
dr = new DefaultDamagerRepairer(stringScanner);
|
||||
reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
|
||||
reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_STRING);
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.jface.viewers.LabelProvider;
|
|||
import org.eclipse.jface.viewers.StyledString;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObject;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObjectType;
|
||||
|
||||
|
@ -114,8 +114,8 @@ final class CompilerSourceParserTreeObjectLabelProvider extends DelegatingStyled
|
|||
*/
|
||||
CompilerSourceParserTreeObjectLabelProvider() {
|
||||
super(new StyledLabelProvider());
|
||||
AssemblerPlugin plugin;
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
LanguagePlugin plugin;
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
defaultImage = plugin.getImage("outline-default-16x16.gif");
|
||||
definitionSectionImage = plugin.getImage("outline-definition-section-16x16.gif");
|
||||
implementationSectionImage = plugin.getImage("outline-implementation-section-16x16.gif");
|
||||
|
|
|
@ -21,7 +21,7 @@ package com.wudsn.ide.lng.editor;
|
|||
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.compiler.CompilerSymbol;
|
||||
import com.wudsn.ide.lng.compiler.CompilerSymbolType;
|
||||
|
||||
|
@ -55,8 +55,8 @@ final class CompilerSymbolLabelProvider {
|
|||
private final Image procedureDefinitionSectionImage;
|
||||
|
||||
CompilerSymbolLabelProvider() {
|
||||
AssemblerPlugin plugin;
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
LanguagePlugin plugin;
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
defaultImage = plugin.getImage("outline-default-16x16.gif");
|
||||
|
||||
equateDefintionImage = plugin.getImage("outline-equate-definition-16x16.gif");
|
||||
|
|
|
@ -48,7 +48,7 @@ import com.wudsn.ide.base.common.StringUtility;
|
|||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.base.hardware.HardwareUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.Compiler;
|
||||
|
@ -105,7 +105,7 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
|
||||
@Override
|
||||
public InputStream getInputStream(String pluginID, String href, Locale locale) {
|
||||
if (AssemblerPlugin.ID.equals(pluginID)) {
|
||||
if (LanguagePlugin.ID.equals(pluginID)) {
|
||||
int index = href.indexOf("?");
|
||||
if (index >= 0) {
|
||||
href = href.substring(0, index);
|
||||
|
@ -134,7 +134,7 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
if (href == null) {
|
||||
throw new IllegalArgumentException("Parameter 'href' must not be null.");
|
||||
}
|
||||
AssemblerPlugin plugin = AssemblerPlugin.getInstance();
|
||||
LanguagePlugin plugin = LanguagePlugin.getInstance();
|
||||
IPath path = new Path(href);
|
||||
InputStream result;
|
||||
try {
|
||||
|
@ -258,8 +258,8 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
}
|
||||
String compilerId = path.substring(0, index);
|
||||
String section = path.substring(index + 1);
|
||||
AssemblerPlugin assemblerPlugin = AssemblerPlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = assemblerPlugin.getCompilerRegistry();
|
||||
LanguagePlugin languagePlugin = LanguagePlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
|
||||
// Find non-empty compiler executable path.
|
||||
Compiler compiler = compilerRegistry.getCompiler(compilerId);
|
||||
|
@ -268,7 +268,7 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
return getInputStream(getCompilerGeneralSection(compiler));
|
||||
} else if (section.startsWith(SECTION_MANUAL)) {
|
||||
|
||||
String compilerExecutablePath = assemblerPlugin.getPreferences().getCompilerExecutablePath(compilerId);
|
||||
String compilerExecutablePath = languagePlugin.getPreferences().getCompilerExecutablePath(compilerId);
|
||||
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
||||
// ERROR: Help for the '{0}' compiler cannot be
|
||||
// displayed because the path to the compiler executable
|
||||
|
@ -547,8 +547,8 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
return null;
|
||||
}
|
||||
Hardware hardware = Hardware.valueOf(path.toUpperCase());
|
||||
AssemblerPlugin assemblerPlugin = AssemblerPlugin.getInstance();
|
||||
RunnerRegistry runnerRegistry = assemblerPlugin.getRunnerRegistry();
|
||||
LanguagePlugin languagePlugin = LanguagePlugin.getInstance();
|
||||
RunnerRegistry runnerRegistry = languagePlugin.getRunnerRegistry();
|
||||
|
||||
HTMLWriter writer = createHeader();
|
||||
|
||||
|
@ -604,8 +604,8 @@ public final class AssemblerHelpContentProducer implements IHelpContentProducer
|
|||
}
|
||||
|
||||
Target target = Target.valueOf(path.toUpperCase());
|
||||
AssemblerPlugin assemblerPlugin = AssemblerPlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = assemblerPlugin.getCompilerRegistry();
|
||||
LanguagePlugin languagePlugin = LanguagePlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
|
||||
HTMLWriter writer = createHeader();
|
||||
|
||||
|
|
|
@ -39,12 +39,12 @@ import org.eclipse.help.IUAElement;
|
|||
|
||||
import com.wudsn.ide.base.common.EnumUtility;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
import com.wudsn.ide.lng.compiler.CompilerRegistry;
|
||||
import com.wudsn.ide.lng.preferences.AssemblerPreferences;
|
||||
import com.wudsn.ide.lng.preferences.LanguagePreferences;
|
||||
|
||||
/**
|
||||
* Dynamic help content provider. Uses static pages and the meta data from the
|
||||
|
@ -107,7 +107,7 @@ public final class AssemblerTocProvider extends AbstractTocProvider {
|
|||
|
||||
@Override
|
||||
public String getContributorId() {
|
||||
return AssemblerPlugin.ID;
|
||||
return LanguagePlugin.ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -164,7 +164,7 @@ public final class AssemblerTocProvider extends AbstractTocProvider {
|
|||
label = resourceBundle.getString(key);
|
||||
} catch (MissingResourceException ex) {
|
||||
label = href + " - Text missing";
|
||||
AssemblerPlugin.getInstance().logError("Resource for enum value {0} is missing.", new Object[] { key }, ex);
|
||||
LanguagePlugin.getInstance().logError("Resource for enum value {0} is missing.", new Object[] { key }, ex);
|
||||
}
|
||||
return createTopic("", label, href, null);
|
||||
}
|
||||
|
@ -195,8 +195,8 @@ public final class AssemblerTocProvider extends AbstractTocProvider {
|
|||
}
|
||||
|
||||
static ITopic[] createTopics() {
|
||||
AssemblerPlugin assemblerPlugin = AssemblerPlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = assemblerPlugin.getCompilerRegistry();
|
||||
LanguagePlugin languagePlugin = LanguagePlugin.getInstance();
|
||||
CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry();
|
||||
List<CompilerDefinition> compilerDefinitions = compilerRegistry.getCompilerDefinitions();
|
||||
|
||||
List<ITopic> ideTopics = createIDETopics();
|
||||
|
@ -245,8 +245,8 @@ public final class AssemblerTocProvider extends AbstractTocProvider {
|
|||
+ AssemblerHelpContentProducer.SECTION_INSTRUCTIONS + AssemblerHelpContentProducer.EXTENSION;
|
||||
ITopic opcodesTopic = createTopic("", Texts.TOC_ASSEMBLER_INSTRUCTIONS_TOPIC_LABEL, href, null);
|
||||
|
||||
AssemblerPreferences assemblerPreferences = AssemblerPlugin.getInstance().getPreferences();
|
||||
String compilerExecutablePath = assemblerPreferences.getCompilerExecutablePath(compilerDefinition.getId());
|
||||
LanguagePreferences languagePreferences = LanguagePlugin.getInstance().getPreferences();
|
||||
String compilerExecutablePath = languagePreferences.getCompilerExecutablePath(compilerDefinition.getId());
|
||||
|
||||
String icon = "";
|
||||
List<ITopic> manualTopics = new ArrayList<ITopic>();
|
||||
|
|
|
@ -33,13 +33,13 @@ import com.wudsn.ide.lng.runner.RunnerId;
|
|||
*/
|
||||
public final class CompilerPreferences {
|
||||
|
||||
private AssemblerPreferences assemblerPreferences;
|
||||
private LanguagePreferences languagePreferences;
|
||||
private Hardware hardware;
|
||||
private String compilerId;
|
||||
|
||||
CompilerPreferences(AssemblerPreferences assemblerPreferences, String compilerId, Hardware hardware) {
|
||||
if (assemblerPreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'assemblerPreferences' must not be null.");
|
||||
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.");
|
||||
|
@ -50,7 +50,7 @@ public final class CompilerPreferences {
|
|||
if (hardware == null) {
|
||||
throw new IllegalArgumentException("Parameter 'hardware' must not be null.");
|
||||
}
|
||||
this.assemblerPreferences = assemblerPreferences;
|
||||
this.languagePreferences = languagePreferences;
|
||||
this.compilerId = compilerId;
|
||||
this.hardware = hardware;
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ public final class CompilerPreferences {
|
|||
*/
|
||||
public Target getTarget() {
|
||||
Target result;
|
||||
String targetString = assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerTargetName(compilerId, hardware));
|
||||
String targetString = languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware));
|
||||
|
||||
if (StringUtility.isEmpty(targetString)) {
|
||||
result = Target.MOS6502;
|
||||
|
@ -122,8 +122,8 @@ public final class CompilerPreferences {
|
|||
* <code>null</code>.
|
||||
*/
|
||||
public String getParameters() {
|
||||
return assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerParametersName(compilerId, hardware));
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,8 +135,8 @@ public final class CompilerPreferences {
|
|||
*/
|
||||
public String getOutputFolderMode() {
|
||||
|
||||
return assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware));
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,8 +149,8 @@ public final class CompilerPreferences {
|
|||
*/
|
||||
public String getOutputFolderPath() {
|
||||
|
||||
return assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware));
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,8 +160,8 @@ public final class CompilerPreferences {
|
|||
*/
|
||||
public String getOutputFileExtension() {
|
||||
|
||||
return assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware));
|
||||
return languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,8 +171,8 @@ public final class CompilerPreferences {
|
|||
* <code>null</code>.
|
||||
*/
|
||||
public String getRunnerId() {
|
||||
String result = assemblerPreferences
|
||||
.getString(AssemblerPreferencesConstants.getCompilerRunnerIdName(compilerId, hardware));
|
||||
String result = languagePreferences
|
||||
.getString(LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware));
|
||||
if (StringUtility.isEmpty(result)) {
|
||||
result = RunnerId.DEFAULT_APPLICATION;
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ public final class CompilerPreferences {
|
|||
if (StringUtility.isEmpty(runnerId)) {
|
||||
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
|
||||
}
|
||||
return assemblerPreferences.getString(
|
||||
AssemblerPreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware, runnerId));
|
||||
return languagePreferences.getString(
|
||||
LanguagePreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware, runnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -212,8 +212,8 @@ public final class CompilerPreferences {
|
|||
if (StringUtility.isEmpty(runnerId)) {
|
||||
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
|
||||
}
|
||||
return assemblerPreferences.getString(
|
||||
AssemblerPreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId));
|
||||
return languagePreferences.getString(
|
||||
LanguagePreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -233,8 +233,8 @@ public final class CompilerPreferences {
|
|||
if (StringUtility.isEmpty(runnerId)) {
|
||||
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
|
||||
}
|
||||
return assemblerPreferences.getBoolean(
|
||||
AssemblerPreferencesConstants.getCompilerRunnerWaitForCompletionName(compilerId, hardware, runnerId));
|
||||
return languagePreferences.getBoolean(
|
||||
LanguagePreferencesConstants.getCompilerRunnerWaitForCompletionName(compilerId, hardware, runnerId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.wudsn.ide.lng.editor.AssemblerEditorCompileCommandPositioningMode;
|
|||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPreferences {
|
||||
public final class LanguagePreferences {
|
||||
|
||||
/**
|
||||
* The preference store to which all calls are delegated.
|
||||
|
@ -45,7 +45,7 @@ public final class AssemblerPreferences {
|
|||
*
|
||||
* @param preferenceStore The preference store, not <code>null</code>.
|
||||
*/
|
||||
public AssemblerPreferences(IPreferenceStore preferenceStore) {
|
||||
public LanguagePreferences(IPreferenceStore preferenceStore) {
|
||||
if (preferenceStore == null) {
|
||||
throw new IllegalArgumentException("Parameter 'preferenceStore' must not be null.");
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public final class AssemblerPreferences {
|
|||
* Gets the text attribute for a token type.
|
||||
*
|
||||
* @param name The name of the preferences for the token type, see
|
||||
* {@link AssemblerPreferencesConstants}.
|
||||
* {@link LanguagePreferencesConstants}.
|
||||
*
|
||||
* @return The text attribute, not <code>null</code>.
|
||||
*/
|
||||
|
@ -74,7 +74,7 @@ public final class AssemblerPreferences {
|
|||
* See {@link AssemblerContentAssistProcessorDefaultCase}.
|
||||
*/
|
||||
public String getEditorContentAssistProcessorDefaultCase() {
|
||||
return getString(AssemblerPreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE);
|
||||
return getString(LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ public final class AssemblerPreferences {
|
|||
* @since 1.6.1
|
||||
*/
|
||||
public String getEditorCompileCommandPositioningMode() {
|
||||
return getString(AssemblerPreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE);
|
||||
return getString(LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,7 +103,7 @@ public final class AssemblerPreferences {
|
|||
if (StringUtility.isEmpty(compilerId)) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerId' must not be empty.");
|
||||
}
|
||||
return getString(AssemblerPreferencesConstants.getCompilerExecutablePathName(compilerId));
|
||||
return getString(LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId));
|
||||
}
|
||||
|
||||
/**
|
|
@ -28,7 +28,7 @@ import java.util.Set;
|
|||
*
|
||||
* @sine 1.7.0
|
||||
*/
|
||||
public interface AssemblerPreferencesChangeListener {
|
||||
public interface LanguagePreferencesChangeListener {
|
||||
|
||||
/**
|
||||
* Notify of changed properties.
|
||||
|
@ -38,5 +38,5 @@ public interface AssemblerPreferencesChangeListener {
|
|||
* @param changedPropertyNames The set of names of properties that have been
|
||||
* changed, may be empty, not <code>null</code>.
|
||||
*/
|
||||
public void preferencesChanged(AssemblerPreferences preferences, Set<String> changedPropertyNames);
|
||||
public void preferencesChanged(LanguagePreferences preferences, Set<String> changedPropertyNames);
|
||||
}
|
|
@ -55,7 +55,7 @@ import com.wudsn.ide.base.common.StringUtility;
|
|||
import com.wudsn.ide.base.common.TextUtility;
|
||||
import com.wudsn.ide.base.gui.SWTFactory;
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Target;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
|
@ -179,7 +179,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
/**
|
||||
* The owning plugin.
|
||||
*/
|
||||
private final AssemblerPlugin plugin;
|
||||
private final LanguagePlugin plugin;
|
||||
|
||||
/**
|
||||
* The tab folder and all visible tab items.
|
||||
|
@ -209,7 +209,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
}
|
||||
this.langauge = language;
|
||||
this.hardware = hardware;
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
IPreferenceStore preferencesStore = plugin.getPreferenceStore();
|
||||
setPreferenceStore(preferencesStore);
|
||||
|
||||
|
@ -338,7 +338,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
}
|
||||
|
||||
FieldEditor comboFieldEditor = new ComboFieldEditor(
|
||||
AssemblerPreferencesConstants.getCompilerTargetName(compilerId, hardware),
|
||||
LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware),
|
||||
Texts.PREFERENCES_COMPILER_TARGET_LABEL, entryNamesAndValues, composite);
|
||||
comboFieldEditor.setEnabled(entryNamesAndValues.length > 1, composite);
|
||||
addField(comboFieldEditor);
|
||||
|
@ -362,7 +362,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
// Field: parameters
|
||||
composite = SWTFactory.createComposite(tabContent, 2, 2, GridData.FILL_HORIZONTAL);
|
||||
StringFieldEditor parametersFieldEditor;
|
||||
name = AssemblerPreferencesConstants.getCompilerParametersName(compilerId, hardware);
|
||||
name = LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware);
|
||||
parametersFieldEditor = new StringFieldEditor(name, Texts.PREFERENCES_COMPILER_PARAMETERS_LABEL, tabContent);
|
||||
|
||||
String compilerParametersHelp = Texts.PREFERENCES_COMPILER_PARAMETERS_HELP + "\n"
|
||||
|
@ -381,7 +381,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
// Field: outputFolderMode
|
||||
composite = SWTFactory.createComposite(tabContent, 2, 2, GridData.FILL_HORIZONTAL);
|
||||
RadioGroupFieldEditorWithAction outputFolderModeChoiceEditor = new RadioGroupFieldEditorWithAction(
|
||||
AssemblerPreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware),
|
||||
LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware),
|
||||
Texts.PREFERENCES_COMPILER_OUTPUT_FOLDER_MODE_LABEL, 3, labelsAndValues, composite);
|
||||
addField(outputFolderModeChoiceEditor);
|
||||
|
||||
|
@ -389,7 +389,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
composite = SWTFactory.createComposite(tabContent, 2, 2, GridData.FILL_HORIZONTAL);
|
||||
StringFieldEditor outputFolderPathFieldEditor;
|
||||
outputFolderPathFieldEditor = new DirectoryFieldDownloadEditor(
|
||||
AssemblerPreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware),
|
||||
LanguagePreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware),
|
||||
Texts.PREFERENCES_COMPILER_OUTPUT_FOLDER_PATH_LABEL, composite);
|
||||
addField(outputFolderPathFieldEditor);
|
||||
|
||||
|
@ -407,7 +407,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
composite = SWTFactory.createComposite(tabContent, 2, 2, GridData.FILL_HORIZONTAL);
|
||||
StringFieldEditor outputFileExtensionFieldEditor;
|
||||
outputFileExtensionFieldEditor = new StringFieldEditor(
|
||||
AssemblerPreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware),
|
||||
LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware),
|
||||
Texts.PREFERENCES_COMPILER_OUTPUT_FILE_EXTENSION_LABEL, composite);
|
||||
|
||||
gd = new GridData(SWT.BEGINNING, SWT.FILL, true, false);
|
||||
|
@ -430,7 +430,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
i++;
|
||||
}
|
||||
comboFieldEditor = new ComboFieldEditor(
|
||||
AssemblerPreferencesConstants.getCompilerRunnerIdName(compilerId, hardware),
|
||||
LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware),
|
||||
Texts.PREFERENCES_COMPILER_RUNNER_ID_LABEL, entryNamesAndValues, composite);
|
||||
addField(comboFieldEditor);
|
||||
createRunnerFieldEdiors(compilerId, composite, controlDecorations);
|
||||
|
@ -457,9 +457,9 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
throw new IllegalArgumentException("Parameter 'tab' must not be null.");
|
||||
}
|
||||
|
||||
AssemblerPreferences assemblerPreferences = plugin.getPreferences();
|
||||
LanguagePreferences languagePreferences = plugin.getPreferences();
|
||||
|
||||
boolean enabled = StringUtility.isSpecified(assemblerPreferences.getCompilerExecutablePath(tab.compilerId));
|
||||
boolean enabled = StringUtility.isSpecified(languagePreferences.getCompilerExecutablePath(tab.compilerId));
|
||||
|
||||
if (!tab.initialized || enabled != tab.enabled) {
|
||||
tab.initialized = true;
|
||||
|
@ -526,7 +526,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
Composite tabContent;
|
||||
tabContent = SWTFactory.createComposite(tabFolder, 2, 1, GridData.FILL_BOTH);
|
||||
|
||||
String name = AssemblerPreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware,
|
||||
String name = LanguagePreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware,
|
||||
runnerId);
|
||||
|
||||
Composite composite;
|
||||
|
@ -554,7 +554,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
// Field: parameters
|
||||
composite = SWTFactory.createComposite(tabContent, 2, 2, GridData.FILL_HORIZONTAL);
|
||||
StringFieldEditor commandLineFieldEditor;
|
||||
name = AssemblerPreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId);
|
||||
name = LanguagePreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId);
|
||||
commandLineFieldEditor = new StringFieldEditor(name, Texts.PREFERENCES_COMPILER_RUNNER_COMMAND_LINE_LABEL,
|
||||
tabContent);
|
||||
|
||||
|
@ -572,7 +572,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
|
||||
// Field: illegalOpcodesVisible
|
||||
composite = SWTFactory.createComposite(tabContent, 2, 3, GridData.FILL_HORIZONTAL);
|
||||
FieldEditor booleanFieldEditor = new BooleanFieldEditor(AssemblerPreferencesConstants
|
||||
FieldEditor booleanFieldEditor = new BooleanFieldEditor(LanguagePreferencesConstants
|
||||
.getCompilerRunnerWaitForCompletionName(compilerId, hardware, runnerId),
|
||||
Texts.PREFERENCES_COMPILER_RUNNER_WAIT_FOR_COMPLETION_LABEL, composite);
|
||||
|
||||
|
@ -609,7 +609,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||
controlDecoration.setShowHover(true);
|
||||
controlDecoration.setDescriptionText(text);
|
||||
|
||||
controlDecoration.setImage(AssemblerPlugin.getInstance().getImage("help-16x16.gif"));
|
||||
controlDecoration.setImage(LanguagePlugin.getInstance().getImage("help-16x16.gif"));
|
||||
|
||||
return controlDecoration;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
|
||||
R * Copyright (C) 2009 - 2021 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
|
||||
*
|
||||
* This file is part of WUDSN IDE.
|
||||
*
|
||||
|
@ -29,12 +29,12 @@ import com.wudsn.ide.base.hardware.Hardware;
|
|||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPreferencesConstants {
|
||||
public final class LanguagePreferencesConstants {
|
||||
|
||||
/**
|
||||
* Creation is private.
|
||||
*/
|
||||
private AssemblerPreferencesConstants() {
|
||||
private LanguagePreferencesConstants() {
|
||||
}
|
||||
|
||||
/**
|
|
@ -30,7 +30,7 @@ import org.eclipse.swt.widgets.Display;
|
|||
|
||||
import com.wudsn.ide.base.hardware.Hardware;
|
||||
import com.wudsn.ide.base.hardware.HardwareUtility;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
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;
|
||||
|
@ -43,23 +43,23 @@ import com.wudsn.ide.lng.runner.RunnerId;
|
|||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPreferencesInitializer extends AbstractPreferenceInitializer {
|
||||
public final class LanguagePreferencesInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
/**
|
||||
* Creation must be public default.
|
||||
*/
|
||||
public AssemblerPreferencesInitializer() {
|
||||
public LanguagePreferencesInitializer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeDefaultPreferences() {
|
||||
IPreferenceStore store = AssemblerPlugin.getInstance().getPreferenceStore();
|
||||
IPreferenceStore store = LanguagePlugin.getInstance().getPreferenceStore();
|
||||
|
||||
initializeEditorPreferences(store);
|
||||
|
||||
initializeCompilerPreferences(store);
|
||||
|
||||
AssemblerPlugin.getInstance().savePreferences();
|
||||
LanguagePlugin.getInstance().savePreferences();
|
||||
}
|
||||
|
||||
private void initializeEditorPreferences(IPreferenceStore store) {
|
||||
|
@ -70,39 +70,39 @@ public final class AssemblerPreferencesInitializer extends AbstractPreferenceIni
|
|||
Display display = Display.getCurrent();
|
||||
|
||||
TextAttribute textAttribute = new TextAttribute(new Color(display, 0, 128, 0), null, SWT.ITALIC);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 0, 0, 255), null, SWT.NORMAL);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 0, 0, 255), null, SWT.BOLD);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 128, 64, 0), null, SWT.BOLD);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 0, 0, 128), null, SWT.BOLD);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 255, 32, 32), null, SWT.BOLD);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
textAttribute = new TextAttribute(new Color(display, 32, 128, 32), null, SWT.BOLD);
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO,
|
||||
TextAttributeConverter.toString(textAttribute));
|
||||
|
||||
// Content assist.
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE,
|
||||
AssemblerContentAssistProcessorDefaultCase.LOWER_CASE);
|
||||
|
||||
// Compiling.
|
||||
store.setDefault(AssemblerPreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
store.setDefault(LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
AssemblerEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public final class AssemblerPreferencesInitializer extends AbstractPreferenceIni
|
|||
throw new IllegalArgumentException("Parameter 'store' must not be null.");
|
||||
}
|
||||
|
||||
CompilerRegistry compilerRegistry = AssemblerPlugin.getInstance().getCompilerRegistry();
|
||||
CompilerRegistry compilerRegistry = LanguagePlugin.getInstance().getCompilerRegistry();
|
||||
|
||||
List<CompilerDefinition> compilerDefinitions = compilerRegistry.getCompilerDefinitions();
|
||||
for (CompilerDefinition compilerDefinition : compilerDefinitions) {
|
||||
|
@ -123,16 +123,16 @@ public final class AssemblerPreferencesInitializer extends AbstractPreferenceIni
|
|||
if (hardware.equals(Hardware.GENERIC)) {
|
||||
continue;
|
||||
}
|
||||
store.setDefault(AssemblerPreferencesConstants.getCompilerTargetName(compilerId, hardware),
|
||||
store.setDefault(LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware),
|
||||
compilerDefinition.getSupportedTargets().get(0).toString());
|
||||
|
||||
name = AssemblerPreferencesConstants.getCompilerParametersName(compilerId, hardware);
|
||||
name = LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware);
|
||||
store.setDefault(name, compilerDefinition.getDefaultParameters());
|
||||
name = AssemblerPreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware);
|
||||
name = LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware);
|
||||
store.setDefault(name, CompilerOutputFolderMode.TEMP_FOLDER);
|
||||
name = AssemblerPreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware);
|
||||
name = LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware);
|
||||
store.setDefault(name, HardwareUtility.getDefaultFileExtension(hardware));
|
||||
name = AssemblerPreferencesConstants.getCompilerRunnerIdName(compilerId, hardware);
|
||||
name = LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware);
|
||||
store.setDefault(name, RunnerId.DEFAULT_APPLICATION);
|
||||
}
|
||||
|
|
@ -58,7 +58,8 @@ import org.eclipse.ui.model.WorkbenchViewerComparator;
|
|||
|
||||
import com.wudsn.ide.base.common.ProcessWithLogs;
|
||||
import com.wudsn.ide.base.gui.SWTFactory;
|
||||
import com.wudsn.ide.lng.AssemblerPlugin;
|
||||
import com.wudsn.ide.lng.LanguagePlugin;
|
||||
import com.wudsn.ide.lng.Language;
|
||||
import com.wudsn.ide.lng.Texts;
|
||||
import com.wudsn.ide.lng.compiler.CompilerDefinition;
|
||||
import com.wudsn.ide.lng.compiler.CompilerRegistry;
|
||||
|
@ -67,11 +68,11 @@ import com.wudsn.ide.lng.editor.AssemblerEditor;
|
|||
import com.wudsn.ide.lng.editor.AssemblerEditorCompileCommandPositioningMode;
|
||||
|
||||
/**
|
||||
* Visual editor page for the assembler preferences.
|
||||
* Visual editor page for the language preferences.
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class AssemblerPreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
private abstract class TextAttributeSelectionListener implements SelectionListener {
|
||||
|
||||
|
@ -99,10 +100,15 @@ public final class AssemblerPreferencesPage extends FieldEditorPreferencePage im
|
|||
abstract protected void updateItem(TextAttributeListItem item);
|
||||
}
|
||||
|
||||
/**
|
||||
* The language.
|
||||
*/
|
||||
private Language language;
|
||||
|
||||
/**
|
||||
* The owning plugin.
|
||||
*/
|
||||
private AssemblerPlugin plugin;
|
||||
private LanguagePlugin plugin;
|
||||
|
||||
/**
|
||||
* The set of property names for which the value was changed since the page was
|
||||
|
@ -148,41 +154,45 @@ public final class AssemblerPreferencesPage extends FieldEditorPreferencePage im
|
|||
/**
|
||||
* Creation must be public default.
|
||||
*/
|
||||
public AssemblerPreferencesPage() {
|
||||
public LanguagePreferencesPage(Language language) {
|
||||
super(GRID);
|
||||
plugin = AssemblerPlugin.getInstance();
|
||||
if (language == null) {
|
||||
throw new IllegalArgumentException("Parameter 'language' must not be null.");
|
||||
}
|
||||
this.language = language;
|
||||
plugin = LanguagePlugin.getInstance();
|
||||
setPreferenceStore(plugin.getPreferenceStore());
|
||||
changedPropertyNames = new TreeSet<String>();
|
||||
textAttributeListItemKeys = new String[][] {
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_COMMENT_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_NUMBER_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_NUMBER },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_STRING_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_DIRECTIVE,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_DIRECTVE },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_LEGAL_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_LEGAL },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_ILLEGAL_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_ILLEGAL },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_OPCODE_PSEUDO_NAME,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_OPCODE_PSEUDO },
|
||||
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_EQUATE },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LABEL,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LABEL },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_ENUM_DEFINITION_SECTION },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_STRUCTURE_DEFINITION_SECTION },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_LOCAL_SECTION },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION },
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_MACRO_DEFINITION_SECTION },
|
||||
{ Texts.PREFERENCES_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION,
|
||||
AssemblerPreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION } };
|
||||
LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_IDENTIFIER_PROCEDURE_DEFINITION_SECTION } };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -418,7 +428,7 @@ public final class AssemblerPreferencesPage extends FieldEditorPreferencePage im
|
|||
};
|
||||
|
||||
FieldEditor choiceFieldEditor = new RadioGroupFieldEditor(
|
||||
AssemblerPreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE,
|
||||
LanguagePreferencesConstants.EDITOR_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE,
|
||||
Texts.PREFERENCES_CONTENT_ASSIST_PROCESSOR_DEFAULT_CASE_LABEL, 2, labelsAndValues, space);
|
||||
addField(choiceFieldEditor);
|
||||
|
||||
|
@ -434,7 +444,7 @@ public final class AssemblerPreferencesPage extends FieldEditorPreferencePage im
|
|||
};
|
||||
|
||||
choiceFieldEditor = new RadioGroupFieldEditor(
|
||||
AssemblerPreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE,
|
||||
Texts.PREFERENCES_COMPILE_COMMAND_POSITIONING_MODE_LABEL, 2, labelsAndValues, space);
|
||||
addField(choiceFieldEditor);
|
||||
|
||||
|
@ -463,7 +473,7 @@ public final class AssemblerPreferencesPage extends FieldEditorPreferencePage im
|
|||
Composite composite;
|
||||
|
||||
String name;
|
||||
name = AssemblerPreferencesConstants.getCompilerExecutablePathName(compilerId);
|
||||
name = LanguagePreferencesConstants.getCompilerExecutablePathName(compilerId);
|
||||
|
||||
// Field: executablePath
|
||||
composite = SWTFactory.createComposite(tabContent, 4, 2, GridData.FILL_HORIZONTAL);
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* 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 org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
|
||||
/**
|
||||
* Structural page
|
||||
*
|
||||
* @author Peter Dell
|
||||
*/
|
||||
public final class LanguagesPreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user