highlight internal exts

This commit is contained in:
sirjonasxx 2021-04-25 19:31:37 +02:00
parent d612eb8c54
commit 60992d9e38
6 changed files with 33 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import gearth.misc.packet_info.PacketInfoManager;
import gearth.protocol.HMessage;
import gearth.protocol.HPacket;
import gearth.protocol.connection.HClient;
import gearth.services.extensionhandler.extensions.ExtensionType;
import gearth.services.extensionhandler.extensions.GEarthExtension;
// wraps internal GEarthExtension class to IExtension interface
@ -136,4 +137,9 @@ public class InternalExtensionBuilder extends GEarthExtension {
// no need in java ext
}
@Override
public ExtensionType extensionType() {
return ExtensionType.INTERNAL;
}
}

View File

@ -0,0 +1,6 @@
package gearth.services.extensionhandler.extensions;
public enum ExtensionType {
INTERNAL,
EXTERNAL
}

View File

@ -123,4 +123,7 @@ public abstract class GEarthExtension {
}
// ----------------------------------------------------------------------------------------
public abstract ExtensionType extensionType();
}

View File

@ -3,6 +3,7 @@ package gearth.services.extensionhandler.extensions.implementations.network;
import gearth.misc.packet_info.PacketInfoManager;
import gearth.protocol.HMessage;
import gearth.protocol.connection.HClient;
import gearth.services.extensionhandler.extensions.ExtensionType;
import gearth.services.extensionhandler.extensions.GEarthExtension;
import gearth.protocol.HPacket;
@ -239,4 +240,9 @@ public class NetworkExtension extends GEarthExtension {
packet.appendLongString(packetFromString.stringify());
sendMessage(packet);
}
@Override
public ExtensionType extensionType() {
return ExtensionType.EXTERNAL;
}
}

View File

@ -4,6 +4,7 @@ import gearth.misc.packet_info.PacketInfoManager;
import gearth.protocol.HMessage;
import gearth.protocol.HPacket;
import gearth.protocol.connection.HClient;
import gearth.services.extensionhandler.extensions.ExtensionType;
import gearth.services.extensionhandler.extensions.GEarthExtension;
public class ExampleExtension extends GEarthExtension {
@ -122,4 +123,9 @@ public class ExampleExtension extends GEarthExtension {
public void stringToPacketResponse(HPacket packet) {
}
@Override
public ExtensionType extensionType() {
return ExtensionType.INTERNAL;
}
}

View File

@ -1,5 +1,6 @@
package gearth.ui.extensions;
import gearth.services.extensionhandler.extensions.ExtensionType;
import gearth.services.extensionhandler.extensions.GEarthExtension;
import javafx.application.Platform;
import javafx.event.EventHandler;
@ -142,6 +143,11 @@ public class ExtensionItemContainer extends GridPane {
parent.getChildren().add(this);
if (item.extensionType() == ExtensionType.INTERNAL) {
setBackground(new Background(new BackgroundFill(Paint.valueOf("F0FFFF"), CornerRadii.EMPTY, Insets.EMPTY)));
}
initExtension();
}