Search in sources :

Example 1 with MdwSettings

use of com.centurylink.mdw.plugin.preferences.model.MdwSettings in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createSwingActionGroup.

private ActionGroup createSwingActionGroup() {
    swingMenu = new MenuManager("Swing Tools", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.swing.tools");
    return new ActionGroup() {

        @Override
        public void fillContextMenu(IMenuManager menu) {
            swingMenu.removeAll();
            IStructuredSelection selection = getSelection();
            if (swingLaunchApplies(selection)) {
                WorkflowProject project = (WorkflowProject) selection.getFirstElement();
                MdwSettings settings = MdwPlugin.getSettings();
                if (settings.isSwingLaunchEventManager() && project.isUserAuthorizedForSystemAdmin())
                    swingMenu.add(eventManagerAction);
                if (settings.isSwingLaunchThreadPoolManager() && project.isUserAuthorizedForSystemAdmin())
                    swingMenu.add(threadPoolManagerAction);
            }
        }
    };
}
Also used : ActionGroup(org.eclipse.ui.actions.ActionGroup) MdwSettings(com.centurylink.mdw.plugin.preferences.model.MdwSettings) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) MdwMenuManager(com.centurylink.mdw.plugin.actions.MdwMenuManager) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) IMenuManager(org.eclipse.jface.action.IMenuManager) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 2 with MdwSettings

use of com.centurylink.mdw.plugin.preferences.model.MdwSettings in project mdw-designer by CenturyLinkCloud.

the class ProcessCanvasWrapper method populate.

@Override
public void populate() {
    MdwSettings settings = MdwPlugin.getSettings();
    RGB rgb = settings.getReadOnlyBackground();
    readOnlyBackgroundColor = new Color(rgb.red, rgb.green, rgb.blue);
    if (isInstance())
        processInstancePage = getDesignerProxy().newProcessInstancePage();
    super.populate();
    designerCanvasSelection = getProcess();
    designerCanvasSelection.addDirtyStateListener(this);
}
Also used : MdwSettings(com.centurylink.mdw.plugin.preferences.model.MdwSettings) Color(java.awt.Color) RGB(org.eclipse.swt.graphics.RGB)

Example 3 with MdwSettings

use of com.centurylink.mdw.plugin.preferences.model.MdwSettings in project mdw-designer by CenturyLinkCloud.

the class CustomTaskManager method addTo.

@Override
public boolean addTo(WorkflowProject project, IProgressMonitor monitor) throws ExtensionModuleException {
    monitor.worked(5);
    try {
        updateApplicationXml(project, project.getWebProjectName() + ".war", project.getWebProjectName(), new SubProgressMonitor(monitor, 5));
        MdwSettings mdwSettings = MdwPlugin.getSettings();
        ProjectInflator inflator = new ProjectInflator(project, mdwSettings);
        inflator.generateWebArtifacts(new SubProgressMonitor(monitor, 5));
        ProjectUpdater updater = new ProjectUpdater(project, mdwSettings);
        ProjectConfigurator configurator = new ProjectConfigurator(project, mdwSettings);
        updater.updateWebProjectJars(new SubProgressMonitor(monitor, 30));
        configurator.createWebProjectSourceCodeAssociations(null, monitor);
        monitor.worked(5);
    } catch (Exception ex) {
        throw new ExtensionModuleException(ex.getMessage(), ex);
    }
    return true;
}
Also used : ProjectInflator(com.centurylink.mdw.plugin.project.assembly.ProjectInflator) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) MdwSettings(com.centurylink.mdw.plugin.preferences.model.MdwSettings) ProjectUpdater(com.centurylink.mdw.plugin.project.assembly.ProjectUpdater) SubProgressMonitor(org.eclipse.core.runtime.SubProgressMonitor) CoreException(org.eclipse.core.runtime.CoreException) IOException(java.io.IOException) XmlException(org.apache.xmlbeans.XmlException)

Example 4 with MdwSettings

use of com.centurylink.mdw.plugin.preferences.model.MdwSettings in project mdw-designer by CenturyLinkCloud.

the class PluginUtil method sendEmail.

public static void sendEmail(String subject, String content) throws MessagingException, AddressException {
    MdwSettings settings = MdwPlugin.getSettings();
    Properties props = new Properties();
    props.put("mail.transport.protocol", MAIL_PROTOCOL);
    props.put("mail.host", settings.getSmtpHost());
    props.put("mail.smtp.port", settings.getSmtpPort());
    Session session = Session.getInstance(props);
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(MAIL_FROM_ADDRESS));
    message.setSubject(subject);
    message.setRecipients(Message.RecipientType.TO, new Address[] { new InternetAddress(MDW_DEV_EMAIL_GROUP) });
    Multipart multiPart = new MimeMultipart();
    BodyPart bodyPart = new MimeBodyPart();
    bodyPart.setContent(content, "text/plain");
    multiPart.addBodyPart(bodyPart);
    message.setContent(multiPart);
    message.setSentDate(new Date());
    Transport.send(message);
}
Also used : MimeBodyPart(javax.mail.internet.MimeBodyPart) BodyPart(javax.mail.BodyPart) InternetAddress(javax.mail.internet.InternetAddress) MimeMultipart(javax.mail.internet.MimeMultipart) Multipart(javax.mail.Multipart) Message(javax.mail.Message) MimeMessage(javax.mail.internet.MimeMessage) MdwSettings(com.centurylink.mdw.plugin.preferences.model.MdwSettings) MimeMessage(javax.mail.internet.MimeMessage) MimeMultipart(javax.mail.internet.MimeMultipart) Properties(java.util.Properties) MimeBodyPart(javax.mail.internet.MimeBodyPart) Date(java.util.Date) Session(javax.mail.Session)

Aggregations

MdwSettings (com.centurylink.mdw.plugin.preferences.model.MdwSettings)4 MdwMenuManager (com.centurylink.mdw.plugin.actions.MdwMenuManager)1 ProjectConfigurator (com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator)1 ProjectInflator (com.centurylink.mdw.plugin.project.assembly.ProjectInflator)1 ProjectUpdater (com.centurylink.mdw.plugin.project.assembly.ProjectUpdater)1 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)1 Color (java.awt.Color)1 IOException (java.io.IOException)1 Date (java.util.Date)1 Properties (java.util.Properties)1 BodyPart (javax.mail.BodyPart)1 Message (javax.mail.Message)1 Multipart (javax.mail.Multipart)1 Session (javax.mail.Session)1 InternetAddress (javax.mail.internet.InternetAddress)1 MimeBodyPart (javax.mail.internet.MimeBodyPart)1 MimeMessage (javax.mail.internet.MimeMessage)1 MimeMultipart (javax.mail.internet.MimeMultipart)1 XmlException (org.apache.xmlbeans.XmlException)1 CoreException (org.eclipse.core.runtime.CoreException)1