Fabric Registering an Item Twice - minecraft

Whenever I run the client from vsc it crashes because it can't execute the entrypoint which is caused by it trying to register an item twice,
Caused by: java.lang.RuntimeException: Attempted to register ID ResourceKey[minecraft:item / cauldrons:gold-base] at different raw IDs (1100, 1102)! If you're trying to override an item, use .set(), not .register()!
and my code in the .java file is:
package net.cauldrons;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class cauldrons implements ModInitializer {
// bases
public static final Item GOLD_BASE = new Item(new FabricItemSettings().group(ItemGroup.BREWING));
public static final Item IRON_BASE = new Item(new FabricItemSettings().group(ItemGroup.BREWING));
public static final Item DIAMOND_BASE = new Item(new FabricItemSettings().group(ItemGroup.BREWING));
public static final Item NETHERITE_BASE = new Item(new FabricItemSettings().group(ItemGroup.BREWING));
#Override
public void onInitialize() {
Registry.register(Registry.ITEM, new Identifier("cauldrons", "gold-base"), GOLD_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "iron-base"), IRON_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "gold-base"), DIAMOND_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "iron-base"), NETHERITE_BASE);
}
}
Does anyone know what could be causing this?

You are trying to register cauldrons:gold-base and cauldrons:iron-base twice. What you are likely trying to do is register cauldrons:diamond_base and cauldrons:netherite_base, but it looks like you copy-pasted the registration without actually setting those values.
Fixed code:
#Override
public void onInitialize() {
Registry.register(Registry.ITEM, new Identifier("cauldrons", "gold-base"), GOLD_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "iron-base"), IRON_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "diamond-base"), DIAMOND_BASE);
Registry.register(Registry.ITEM, new Identifier("cauldrons", "netherite-base"), NETHERITE_BASE);
}

Related

Where to put and how to read from manually created DB file using Xamarin forms?

I created questions.db file using DB Browser.
Here it is: My lovely .db file
I want to add it to Xamarin.Forms solution and read data from it. (This is going to be quiz app)
That sounds pretty simple, right, but I'm stuck googling for hours. Most answers just link to this https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/data/databases
Which explains nothing about the manually created database file, where to put it etc.
EDIT: this is what I'm trying to achieve: https://arteksoftware.com/deploying-a-database-file-with-a-xamarin-forms-app/
Sadly, the guide is outdated and many things of it doesn't work.
So where do I put my .db file? In MyApp.Android Assets and Resources for MyApp.iOS? If so, how do I get DBpath string then for new connection?
_database = new SQLiteAsyncConnection(dbPath);
If what you want to do is:
Add a pre existing database to your project and load that database to be used by your App then keep on reading.
Short Answer
You need to add your database file to a specific folder in the paltform project (Assets in Android, in iOS you can simply create a folder and put the file there) and use DependencyService to access it. Copy the database file to somewhere in your device (App data folder or InternalStorage or watever is allowed on each platform) and use that final path in the SQLite constructor. From now on, you can simply use that SQLite connection as any other to perform CRUD operation on your Database.
Long Answer
I will now describe how to achieve this step by step from creating a new Xamarin.Forms project to reading data from the preloaded database.
Note: the follwoing solution will only cover the Android part of the CrossPlatform solution. Extending this to iOS should be no problem.
Disclaimer: The code presented next should just be taken as a guideline and by no means I suggest that is proved or production like.
0. Getting project ready:
Create a new Xamarin.Forms project (on my case i use Visual Studio v. 16.3.8 and the new project has Xamarin.Forms 4.2 installed)
Then, first of all, install sqlite nuget package in ALL your projects:
1. Prepare your Database
In App.xaml.cs file
// Create db static property to perform the
// Database calls from around the project
public static Database db { get; set; }
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
Create a new class file and name it Database.cs. There you open the database connection.
public class Database
{
// Create a SQLiteAsyncConnection property to be accessed
// publicly thru your App.
public SQLiteAsyncConnection DBInstance { get; set; }
public Database(String databasePath)
{
DBInstance = new SQLiteAsyncConnection(databasePath);
}
private async Task<string> GetDatabaseFilePath()
{
return await DependencyService.Get<IPathFinder>().GetDBPath();
}
}
So far so good, but... What should actually be the path of your preloaded database?
Well, that is the next part.
2. Load pre-existent database to your project and get a path to it (Android)
So the big question is where to store your pre-existent database in the project.
One option is to add it as an Asset. To implement this approach, do the following:
2.1 Add database file to Assets folder in Android project
Now we want to access that database. To do so, follow the next steps:
2.2 Create an Interface IPathFinder in your App project
And there define a single member GetDBPath()
public interface IPathFinder
{
Task<String> GetDBPath();
}
Now, in your Android project create a class file PathFinder.cs to implement this interface
and implement the method (Note the Dependency Attribute above the namespace!)
using System;
using SysIO = System.IO;
using System.Threading.Tasks;
using Java.IO;
using Xamarin.Forms;
using TestDB.Droid;
[assembly: Dependency(typeof(PathFinder))]
namespace TestDB.Droid
{
public class PathFinder : IPathFinder
{
public async Task<string> GetDBPath()
{
String dbPath = String.Empty;
if (await PermissonManager.GetPermission(PermissonManager.PermissionsIdentifier.Storage))
{
String systemPath = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.RootDirectory.Path).Path;
String tempFolderPath = SysIO::Path.Combine(systemPath, "MytestDBFolder");
if (!SysIO::File.Exists(tempFolderPath))
{
new File(tempFolderPath).Mkdirs();
}
dbPath = SysIO::Path.Combine(tempFolderPath, "test.db");
if (!SysIO::File.Exists(dbPath))
{
Byte[] dbArray;
using (var memoryStream = new SysIO::MemoryStream())
{
var dbAsset = MainActivity.assets.Open("test.db");
dbAsset.CopyTo(memoryStream);
dbArray = memoryStream.ToArray();
}
SysIO.File.WriteAllBytes(dbPath, dbArray);
}
}
return dbPath;
}
}
}
In the GetDBPath() method, the first to note is the GetPermission method. This is needed since Android API 23 in order to manage the App permissions.
Create a file called PermissonManager in your Android project
And add the code below
using System;
using System.Threading.Tasks;
using Android;
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Support.V4.App;
namespace TestDB.Droid
{
public class PermissonManager
{
public enum PermissionsIdentifier
{
Storage // Here you can add more identifiers.
}
private static String[] GetPermissionsRequired(PermissionsIdentifier identifier)
{
String[] permissions = null;
if (identifier == PermissionsIdentifier.Storage)
permissions = PermissionExternalStorage;
return permissions;
}
private static Int32 GetRequestId(PermissionsIdentifier identifier)
{
Int32 requestId = -1;
if (identifier == PermissionsIdentifier.Storage)
requestId = ExternalStorageRequestId;
return requestId;
}
public static TaskCompletionSource<Boolean> PermissionTCS;
public static readonly String[] PermissionExternalStorage = new String[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage };
public const Int32 ExternalStorageRequestId = 2;
public static async Task<Boolean> GetPermission(PermissionsIdentifier identifier)
{
Boolean isPermitted = false;
if ((Int32)Build.VERSION.SdkInt < 23)
isPermitted = true;
else
isPermitted = await GetPermissionOnSdk23OrAbove(GetPermissionsRequired(identifier), GetRequestId(identifier));
return isPermitted;
}
private static Task<Boolean> GetPermissionOnSdk23OrAbove(String[] permissions, Int32 requestId)
{
PermissionTCS = new TaskCompletionSource<Boolean>();
if (MainApplication.CurrentContext.CheckSelfPermission(permissions[0]) == (Int32)Permission.Granted)
PermissionTCS.SetResult(true);
else
ActivityCompat.RequestPermissions((Activity)MainApplication.CurrentContext, permissions, requestId);
return PermissionTCS.Task;
}
public static void OnRequestPermissionsResult(Permission[] grantResults)
{
PermissionTCS.SetResult(grantResults[0] == Permission.Granted);
}
}
}
In that class you note the presence of MainApplication, which provides the CurrentContext. You will also have to add that class file
and there add the following code
using System;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
namespace DemoDB.Droid
{
[Application]
public partial class MainApplication : Application, Application.IActivityLifecycleCallbacks
{
private static Context _currentContext = Application.Context;
internal static Context CurrentContext
{
get => _currentContext;
private set
{
_currentContext = value;
}
}
internal static String FileProviderAuthority
{
get => MainApplication.CurrentContext.ApplicationContext.PackageName + ".fileprovider";
}
public MainApplication(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer)
{
}
public override void OnCreate()
{
base.OnCreate();
RegisterActivityLifecycleCallbacks(this);
}
public override void OnTerminate()
{
base.OnTerminate();
UnregisterActivityLifecycleCallbacks(this);
}
public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
{
CurrentContext = activity;
}
public void OnActivityDestroyed(Activity activity)
{
}
public void OnActivityPaused(Activity activity)
{
}
public void OnActivityResumed(Activity activity)
{
CurrentContext = activity;
}
public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
{
}
public void OnActivityStarted(Activity activity)
{
CurrentContext = activity;
}
public void OnActivityStopped(Activity activity)
{
}
}
}
Then your PermissonManager is almost ready. Now you just have to override OnRequestPermissionsResult in the MainActivity file
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
PermissonManager.OnRequestPermissionsResult(grantResults);
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
Getting back to the GetPath() method, you see a mysterious MainActivity.assets property call. This has to be created in the MainActivity as follows
public static AssetManager assets;
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
assets = this.Assets;
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
Almost ready! Now you just call your database.
3. Use your database!
From the OnAppearing of the Main page, make a simple call to the database, to create it and access it.
protected override async void OnAppearing()
{
String databasePath = await Database.GetDatabaseFilePath();
App.db = new Database(databasePath);
var table = await App.db.DBInstance.CreateTableAsync<Category>();
// here Category is a class that models the objects
// present in my pre-existent database
List<Category> categories = new List<Category>();
categories = await App.db.DBInstance.Table<Category>().ToListAsync();
base.OnAppearing();
}
And that is it.
I hope this is helpful :P

java.lang.NullPointerException: null on AutoWiring a bean in StandAlone App

When trying to use #AutoWire feature with one of StandAlone Application unable to do so instead getting Null Pointer Exception. Please highlight my mistakes if any. Your help is appreciated.
Spring Ver 5.1.5.RELEASE and we're not using any xml config file to tell spring there are annotated classes to look into instead using #ComponentScan or #EnableAutoConfiguration at the top of AppConfig and boost strap the Context from main() class as a first line. But Autowiring works perfectly with internal bean/java classes of jdk(Environment) but not with custom POJO classes. If we're trying to get through getBean method then it works. But I'm trying to avoid creating context everywhere and using getBean() Please Refer below and help me only with your valuable guidelines.
public class ContextMaster {
private static AnnotationConfigApplicationContext appContext;
public static AnnotationConfigApplicationContext getApplicationContext() {
if (appContext == null) {
appContext = new AnnotationConfigApplicationContext(ContextConfig.class);
//appContext = new AnnotationConfigApplicationContext("com.xx.xx.xxx","xx.xxx.xxxx.xxx.datamanager");
logger.debug("Context Invoked !!");
}
return appContext;
}
}
#Configuration
#EnableAutoConfiguration
#PropertySource("classpath:db.properties")
#EnableTransactionManagement
#ComponentScans(value = {
#ComponentScan(basePackages = "xxxxx.datamanager"),
#ComponentScan(basePackages = "com.xx.xx.xxx"),
#ComponentScan(basePackages = "com.xx.xx.xxx.utils")})
public class AppConfig {
#Autowired
private Environment env;
#Bean
public DataSource getDataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(env.getProperty("db.driver"));
dataSource.setUrl(env.getProperty("db.url"));
return dataSource;
}
#Bean
public LocalSessionFactoryBean getSessionFactory() {
LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
//LocalSessionFactoryBean sessionFactoryBean = new AnnotationSessionFactoryBean();
factoryBean.setDataSource(getDataSource());
Properties props=new Properties();
props.put("hibernate.show_sql", env.getProperty("hibernate.show_sql"));
props.put("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
props.put("hibernate.cache.region.factory_class", env.getProperty("hibernate.cache.region.factory_class"));
factoryBean.setHibernateProperties(props);
factoryBean.setAnnotatedClasses(xx.class, xxxx.class, xxxx.class, xxx.class);
return factoryBean;
}
#Bean
public HibernateTransactionManager getTransactionManager() {
return transactionManager;
}
}
// Here is NPE thrown when tried with auto-configured bean
#Component
public class Good extends Good11 {
#Autowired
private RxxxDyyyyHelper rdh;
//RxxxDyyyyHelper rdh =
ContextHelper.getApplicationContext().getBean(RxxxDyyyyHelper .class);
rdh.setProperty(); // NPE here
rdh.getProperty(); // NPE
}
// Here we're trying to initiate the LosUtils class
public class LosUtils {
public static void main(String args[]) throws Exception {
AnnotationConfigApplicationContext applicationContext = `ContextHelper.getApplicationContext();`
}
It seems like you didn't put the full code here, because your Good class won't compile this way..

Intercept Error constructor with bytebuddy

For some reason I can't work out yet, my agent doesn't intercept java LinkageError instances.
Agent code:
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.SuperMethodCall;
import net.bytebuddy.matcher.ElementMatchers;
import java.lang.instrument.Instrumentation;
public class MyAgent {
public static void premain(String arguments, Instrumentation instrumentation) {
new AgentBuilder.Default()
.type(ElementMatchers.isSubTypeOf(LinkageError.class))
.transform((builder, type, classLoader, module) ->
builder.constructor(ElementMatchers.isDefaultConstructor())
.intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.to(MyInterceptor.class)))
).installOn(instrumentation);
}
}
Interceptor code:
public class MyInterceptor {
#RuntimeType
public static void intercept(#Origin Constructor<?> constructor) throws Exception {
System.out.println("Intercepted: " + constructor.getName());
}
}
Test code:
public static void main(String[] args) {
new NoClassDefFoundError("should be intercepted!!!").toString();
new Foo("oh").toString();
}
What is puzzling is that replacing ElementMatchers.isSubTypeOf(LinkageError.class) with ElementMatchers.nameContains("Foo") gives the expected result and Foo constructor is intercepted.
The NoClassDefFoundError is loaded by the bootstrap loader. It willnot be able to see your interceptor class which is why it is never triggered.
Try using the Advice class (as a visitor) to add bytecode to matched classes which should resolve this problem.

Reading application.properties from any class in spring boot

When I add a property in the application.properties files, this can be access from the main class without any problem.
#SpringBootApplication
#ComponentScan(basePackages = "com.example.*")
public class MailTestApplication implements CommandLineRunner {
#Value("${admin.mail}")
String email;
public static void main(String[] args) {
SpringApplication.run(MailTestApplication.class, args);
}
#Override
public void run(String... strings) throws Exception {
System.out.println(email);
Email email = new Email();
email.sendMail();
}
}
However, when I try to access it from any other class it is never retrieved.
#Component
public class Email {
#Autowired
private MailSender sender;
#Value("${admin.mail}")
String email;
public Email() {
}
public void sendMail() {
SimpleMailMessage msg = new SimpleMailMessage();
System.out.println(email);
msg.setTo("sample#email.com");
msg.setSubject("Send mail by Spring Boot");
msg.setText("Send mail by Spring Boot");
sender.send(msg);
}
}
I was reading some of the previous questions other users posted without a clear result for me. I even tried to find some examples with similar resutl.
Could someone give me any clue about this?
Thanks a lot in advance.
The #Value should work (Im asuming your class is under the com.example.* package since you are scanning that package) but if you want to do it another way this is what im using :
public class JpaConfiguration {
public static final String TRANSACTION_MANAGER_NAME = "jpaTransactionManager";
#Autowired
Environment applicationProperties;
Then to use it
#Bean
public DriverManagerDataSource driverManagerDataSource() {
DriverManagerDataSource driverConfig = new DriverManagerDataSource();
driverConfig.setDriverClassName(applicationProperties.getProperty("data.jpa.driverClass"));
driverConfig.setUrl(applicationProperties
.getProperty("data.jpa.connection.url"));
driverConfig.setUsername(applicationProperties
.getProperty("data.jpa.username"));
driverConfig.setPassword(applicationProperties
.getProperty("data.jpa.password"));
return driverConfig;
}
UPDATE AFTER GETTING THE GITHUB REPO
I Don't really know what you are trying to build but :
If you do this:
#Override
public void run(String... strings) throws Exception {
//System.out.println(email);
Email email = new Email();
email.sendMail();
}
Then you are creating the instance of the class, and not spring. so you shouldn't be creating the instance yourself there it should be spring.
That said, i dont know if you are creating a web application a command line application or both.
That said ill give you a minor solution to show you that the dependency injection is in fact working.
1_ add a getter to your email on email class. remove the CommandLine interface (If you want to implement this i would recomend you to put CommandLine implmentations on another package say Controller);
And then run your app like this:
#SpringBootApplication
#ComponentScan(basePackages = "com.example")
public class MailTestApplication {
#Value("${admin.mail}")
String email;
public static void main(String[] args) {
// SpringApplication.run(MailTestApplication.class, args);
final ConfigurableApplicationContext context = new SpringApplicationBuilder(MailTestApplication.class).run(args);
Email e = context.getBean(Email.class);
System.out.println(e.getEmail());
}
The Key thing I want to show is that the instance is created by spring thats why the wiring works. and the email gets printed in the console.
Regarding the email class :
#Component
public class Email {
// #Autowired
// private MailSender sender;
#Value("${admin.mail}")
String email;
public Email() {
}
public void sendMail() {
SimpleMailMessage msg = new SimpleMailMessage();
System.out.println(email);
msg.setTo("sample#email.com");
msg.setSubject("Send mail by Spring Boot");
msg.setText("Send mail by Spring Boot");
// sender.send(msg);
}
public String getEmail() {
return email;
}
}
I Comment out the MailSender since I think you need to configure that too, i have made a custom mailSender that uses gmail and other for mailChimp that i can share with you if you need. but again I dont really know what your intent with the app is.
Hope the info helps you.

adding a new command to gdb while using cdt eclipse

Good day,
I am writing to you because I tried to follow your instructions [here: http://wiki.eclipse.org/CDT/cdt-debug-dsf-gdb-extensibility ] for adding a new command to gdb while using cdt eclipse.
I does not seem to work at all. I put print statements in all of the methods of all the extended classes. Nothing gets printed, which indicates that none of these methods are called. Following is my code. What am I missing?
(i didn't get to the point of actually implementing the new services factory since i there
plugin.xml:
<plugin>
<extension
point="org.eclipse.debug.core.launchDelegates">
<launchDelegate
delegate="tracerdubug.MyTracerLaunchDelegate"
id="TracerDubug.MyTracerLaunchDelegate"
modes="debug, run">
</launchDelegate>
</extension>
</plugin>
TracerRunControl:
public class TracerRunControl extends GDBRunControl_7_0 {
public TracerRunControl(DsfSession session) {
super(session);
System.out.println("TracerRunControl");
}
}
//################################################################
public class MyTracerLaunchDelegate extends GdbLaunchDelegate implements ILaunchConfigurationDelegate2{
public MyTracerLaunchDelegate() {
super();
System.out.println("MyTracerLaunchDelegate::ctr()");
}
#Override
public void launch( ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor ) throws CoreException {
System.out.println("MyTracerLaunchDelegate::launch()");
super.launch(config, mode, launch, monitor);
}
#Override
protected IDsfDebugServicesFactory newServiceFactory(String version) {
System.out.println("MyTracerLaunchDelegate");
return new TracerDebugServicesFactory(version);
}
}
//################################################################
public class TracerDebugServicesFactory extends GdbDebugServicesFactory {
public TracerDebugServicesFactory(String version) {
super(version);
// TODO Auto-generated constructor stub
}
#Override
protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
GDBControl_7_0 g = new GDBControl_7_0(session,config);
System.out.println("TracerDebugServicesFactory::createCommandControl");
return g;
}
#Override
protected IRunControl createRunControlService(DsfSession session) {
System.out.println("TracerDebugServicesFactory::createProcessesService");
return new TracerRunControl(session);
}
#Override
protected IProcesses createProcessesService(DsfSession session) {
System.out.println("TracerDebugServicesFactory::createProcessesService");
return new GDBProcesses_7_0(session);
}
}
Thanks,
Shai
I had the same problem and got the answer from another forum. You must add more info and more extensions:
<extension
point="org.eclipse.debug.core.launchDelegates">
<launchDelegate
delegate="tracerdubug.MyTracerLaunchDelegate"
delegate="Tracerdubug.MyTracerLaunchDelegate"
delegateDescription="Your description"
id="org.eclipse.cdt.dsf.gdb.launch.localCLaunch"
modes="debug"
name="My GDB Launch Delegate"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
type="org.eclipse.cdt.launch.applicationLaunchType">
</launchDelegate>
</extension>
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
<launchConfigurationTypeImage
icon="icons/img.gif"
configTypeID="Tracerdubug.MyTracerLaunchDelegate"
id="Tracerdubug.TabGroups.launcher.Image">
</launchConfigurationTypeImage>
</extension>
<extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
type="Tracerdubug.MyTracerLaunchDelegate"
class="Tracerdubug.TabGroups.TabGroupTest"
id="Tracerdubug.TabGroups.TabGroupTest">
</launchConfigurationTabGroup>
</extension>
and you need a new class = Tracerdubug.TabGroups.TabGroupTest:
package Tracerdubug.TabGroups;
import org.eclipse.cdt.dsf.gdb.internal.ui.launching.CDebuggerTab;
import org.eclipse.cdt.dsf.gdb.internal.ui.launching.CMainAttachTab;
import org.eclipse.cdt.dsf.gdb.internal.ui.launching.AttachCDebuggerTab;
import org.eclipse.cdt.launch.ui.CArgumentsTab;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.EnvironmentTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
public class TabGroupTest extends AbstractLaunchConfigurationTabGroup {
// Create an array of tabs to be displayed in the debug dialog
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs =
new ILaunchConfigurationTab[] {,
new CMainAttachTab(),
new CArgumentsTab(),
new EnvironmentTab(),
new SourceLookupTab(),
new CommonTab(),
};
setTabs(tabs);
}
}
You can also create your own tabs, see: http://www.eclipse.org/articles/Article-Launch-Framework/launch.html
My command factory is loaded, I'm now learning how to use an existing service to send the command...