RapidClipse X - PopupView - view

As there's still no manual for migration from RC-4 to RC-X its not easy to create new projects or migrate the old ones.
Does anyone know how to show a PopupView to edit something and to close it again in the popup class after finished activities or on cancel?
different other conceptional changes like grid, item.writebean.... I already solved. But for Popup cant find similar solution.
thanks in advance for every hint.

What I would do is create a new GUI-Element that inherits from Dialog. This view can then be designed with the GUI-Builder. To then show the dialog all you have to do is to create a new instance and then call the open() method on it.
Example: new EditPopup(myBean).open(); <- EditPopup inherits from Dialog
Closing the dialog is as simple as calling this.close();
Hope this helps :)

I have a delete confirmation dialog in a rapidclipse X application.
Perhaps you can use following example to fullfill your request.
Sorry german dialogs and without deeper explanation:
private void btnDelete_onClick(final ClickEvent<Button> event)
{
final HorizontalLayout horlayout=new HorizontalLayout();
final VerticalLayout vertlayout=new VerticalLayout();
final Notification myDelRequest=new Notification();//
final Button btnAbbr=new Button();
this.logger.info("Der Datensatz mit der ID soll gelöscht werden: " + this.nrDmvId.getValue().toString());
if(this.nrDmvId.getValue() != null && this.nrDmvId.getValue() > 0)
{
btnAbbr.addClickListener(evtclose->
{
this.logger.info("Der Datensatz mit der ID wurde nicht gelöscht: " + this.nrDmvId.getValue().toString());
myDelRequest.close();
});
btnAbbr.setText("Abbrechen");
final Button btnDelConf=new Button();
btnDelConf.addClickListener(evtDelete -> {
try {
if(this.binder.validate().isOk())
{
final boolean confirm = new OkmDbMetadataValueDAO().removeById(this.nrDmvId.getValue().longValue());
this.logger.info("Der Datensatz mit der ID ist gelöscht: " + this.nrDmvId.getValue().toString()+ ", Rückgabe= "+ Boolean.toString(confirm));
this.btnDelete.setVisible(false);
this.btnSave.setVisible(false);
this.fiRegalplatz.setVisible(false);
this.fiposition.setVisible(false);
this.fiKurzBez.setVisible(false);
this.fiBeschreibung.setVisible(false);
this.frmRegale.setVisible(false);
}
}
catch(final Exception e)
{
e.printStackTrace();
}
myDelRequest.close();
});
btnDelConf.setText("Daten löschen");
vertlayout.add(new Label("Wollen Sie den Datensatz wirklich löschen?"));
vertlayout.add(horlayout);
horlayout.add(btnAbbr);
horlayout.add(btnDelConf);
myDelRequest.add(vertlayout);
myDelRequest.setPosition(Position.MIDDLE);
myDelRequest.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
myDelRequest.open();
}
}

Below you will find a second example, which I use to open a dialog with a listbox in it.
After selecting a value out of listbox I transfer and use it in the underlying form:
private void btEditL1_onClick(final ClickEvent<Button> event)
{
//modal Dialog Mainclassification
final HorizontalLayout horlayout=new HorizontalLayout();
final VerticalLayout vertlayout=new VerticalLayout();
final Notification MyL1Selection=new Notification();//
final Button btnAbbruch=new Button();
final ComboBox<TfinGroup> cBL1Liste = new ComboBox<>();
btnAbbruch.setText("Abbruch");
vertlayout.add(new Label("Bitte wählen Sie eine Klasse?"));
horlayout.add(cBL1Liste);
horlayout.add(btnAbbruch);
vertlayout.add(horlayout);
cBL1Liste.setDataProvider(DataProvider.ofCollection(TfinGroupDAO.INSTANCE.findMainGroups()));
cBL1Liste.setItemLabelGenerator(ItemLabelGeneratorFactory
.NonNull(v -> CaptionUtils.resolveCaption(v, "{%id}, {%groupName}")));
cBL1Liste.addValueChangeListener(evtChangeSelektion ->
{
this.logger.info("Es wurde ein Wert aus der Liste selektiert: "+ evtChangeSelektion.getValue().getId());
// muss zu cB2 übergeben werden und in Textfeld nrL1Id
this.nrL1Id.setValue((double)evtChangeSelektion.getValue().getId());
MyL1Selection.close();
});
btnAbbruch.addClickListener(evtclose->
{
this.logger.info("Abbrechen geklickt");
MyL1Selection.close();
});
vertlayout.add(horlayout);
horlayout.add(btnAbbruch);
MyL1Selection.add(vertlayout);
MyL1Selection.setPosition(Position.MIDDLE);
MyL1Selection.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
MyL1Selection.open();
this.btnEditL2.setVisible(true);
}

Related

Created OutLook VSTO Add-In Project in VisualStudio 2019 , how to show a image in place of default ribbon text?

I am trying to implement - Read email panel using a button with custom image using "outlook VSTO Add-In".
With below code, I am able to add a "Read a Loud Button" to home toolbar but my requirement is to add a button with custom image to Read email window, Could you please suggest how to achieve this behavior?
Thanks in advance.
private Office.CommandBar newToolBar;
private Office.CommandBarButton newToolBarButton;
private System.Speech.Synthesis.SpeechSynthesizer syn = new System.Speech.Synthesis.SpeechSynthesizer();
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
// Add new Toolbar, if not exist
if (newToolBar == null)
{
newToolBar = Application.ActiveExplorer().CommandBars.Add("MyToolBar", Office.MsoBarPosition.msoBarTop, false, true);
// Add Button to Toolbar
newToolBarButton = (Office.CommandBarButton)newToolBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, missing, true);
newToolBarButton.Caption = "Stop Voice";
newToolBarButton.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(newToolBarButton_Click);
newToolBar.Visible = true;
}
Application.NewMailEx += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_NewMailExEventHandler(Application_NewMailEx);
}
// New Mail Event Handler
void Application_NewMailEx(string EntryIDCollection)
{
try
{
if (((Outlook.MailItem)this.Application.Session.GetItemFromID(EntryIDCollection, missing)).UnRead)
{
var body = ((Outlook.MailItem)this.Application.Session.GetItemFromID(EntryIDCollection, missing)).Body;
var subject = ((Outlook.MailItem)this.Application.Session.GetItemFromID(EntryIDCollection, missing)).Subject;
var sender = ((Outlook.MailItem)this.Application.Session.GetItemFromID(EntryIDCollection, missing)).SenderName;
syn.SpeakAsync("Mail From " + sender + "Subject is " + subject + body);
}
}
catch
{
}
}
void newToolBarButton_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
{
syn.SpeakAsyncCancelAll();
}
Command bars were deprecated. Instead, you need to use the Fluent UI (aka Ribbon UI). The following articles explain how to create a custom UI for the ribbon:
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML
The Fluent UI is described in depth in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

AIML bot cannot find config folder in Xamarin.Forms

I'm creating a Xamarin.Forms application and I'm trying to implement an AIML bot based on this tutorial: https://www.effacestudios.com/how-to-create-artificial-intelligence-chatbot/. I've added all the references and I've added a config and aiml folder into my directory. This is the code for when a button is clicked:
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void Button_Clicked(object sender, EventArgs e)
{
string settingsPath = Path.Combine(Environment.CurrentDirectory, Path.Combine("config", "Settings.xml"));
string otherPath = #"C:/Users/PAVILION/Desktop/AimlTest/AimlTest/AimlTest/bin/Debug/netstandard2.0/config/Settings.xml";
Bot AI = new Bot();
AI.loadSettings(otherPath);
AI.loadAIMLFromFiles();
AI.isAcceptingUserInput = false;
User myuser = new User("User1", AI);
AI.isAcceptingUserInput = true;
Request r = new Request(UserEntry.Text, myuser, AI);
Result res = AI.Chat(r);
BotEntry.Text = "Tutorial Bot: " + res.Output;
}
}
Any time I input text into the Entry and tap the button I get an Unable to find specified file on the loadSettings();. I believe the function is looking for a Settings.xml and even though I've directed it to the exact file it still cannot be found. Any help is appreciated.
You need to decompile aiml dll and then change loadsetting path to constant environment.specialfolder.loadapplication.
make sure you have placed your all required file there first.

Can anyone tell my why my gif/Label wont show

I've inserted the code below. My Jframes pop up, and close when they're supposed to, but nothing shows u inside of my JFrame. It should say "sending..." next to a gif of a loading bar. I've tried everything. I freatly appreciate any and all help. Thank You
package image_processor;
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
/*
* To change this license header, choose License Headers in ProjectProperties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* #author root
*/
public class SendingGUI {
public void sending() {
JFrame frame = new JFrame("Sending Image(s)");
JFrame frame2 = new JFrame("Image(s) Sent!");
ImageIcon gifImage = new ImageIcon("/opt/med-seg-netbeans/med-seg /senderGUI/ajax-loader.gif");
JLabel label1 = new JLabel("Sending, please wait... ",gifImage, JLabel.CENTER);
JLabel label2 = new JLabel("Images Sent. Processing...",gifImage,JLabel.CENTER);
frame.add(label1);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(350, 150);
frame.setVisible(true);
try{
Thread.sleep(4000);
}catch(InterruptedException e){
}
frame.setVisible(false);
frame2.add(label2);
frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame2.setSize(350, 150);
frame2.setVisible(true);
frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING,frame2));
try{
Thread.sleep(3000);
}catch(InterruptedException e){
}
frame2.setVisible(false);
}
}
The code is correct.
I suspect your image URL is incorrect, or alternatively, the Label may not support animated.
Solution:
Try using a different image. Ideally a non-animated image.
If you're using Windows, place the image in C:\ drive so the code will read:
ImageIcon gifImage = new ImageIcon("C:/image.gif");

Start PowerPoint Slideshow using Microsoft.Interop

I'm totally new to C#. Using the Microsoft.Office.Interop.PowerPoint namespace, I want to be able to start a PowerPoint Presentation from code. There's a path and a finished presentation, and I want it to start in full screen automatically.
How can I do that?
Thank you.
Try this:
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
using PPT = Microsoft.Office.Interop.PowerPoint;
namespace PowerPointLauncher
{
public void StartPresentation()
{
PPT.Application app = new PPT.Application();
//optionally on SlideShowEnd close all powerpoint windows created by your application (app)
app.SlideShowEnd += App_SlideShowEnd;
var pres = app.Presentations.Open("d:\\test.ppt", MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoTrue);
app.ActivePresentation.SlideShowSettings.Run();
}
private void App_SlideShowEnd(Presentation Pres)
{
foreach (DocumentWindow window in Pres.Application.Windows)
{
window.Close();
}
}
}

Using JAX-RS and trying to DELETE an item

I am currently working in Enterprise Java and I'm a newbie. I am trying to create a method which should delete a selected item from a data table. My project contains Graphical User Interface elements from "http://www.primefaces.org/showcase/".
The deletion is made through a web-service.
This is the method I created so far:
public boolean delete(String articleId) {
Client client = ClientBuilder.newClient();
WebTarget target
= client.target(DELETE_URL);//this is a String
//TODO call ws method delete
try{
target.request()....;
} catch(Exception ex) {
LOGGER.error("Delete Article Error ", ex);
}
return true;
}
Could you tell me how can I handle the deletion in an appropiate way?
All the best!
In your case the following should do the trick.
target.request().delete(Response.class)

Resources