components

MediaTracker - how to use it, what are the benefits, or is there an alterative?

爱⌒轻易说出口 提交于 2020-01-19 12:55:22
问题 In the codebase we inherited the usage of MediaTracker was always done locally in each code block. new MediaTracker(new Canvas()); mediatracker.addImage(i, 1); try { mediatracker.waitForAll(); } catch (InterruptedException e) { } mediatracker.removeImage(i); Deciding this was inefficient, I eventually replaced it with a static instance and method: final static protected MediaTracker mediatracker = new MediaTracker(new Canvas()); static protected void checkImageIsReady(Image i) { mediatracker

Angular2 how to call function on click event from another component

杀马特。学长 韩版系。学妹 提交于 2020-01-17 07:28:18
问题 I have two components : Menu1and2 and Menu3 Here's my Menu1and2.component.html <form id="form1" runat="server" class="mainMenuContainer"> <div class="col-lg-12" id="menuContainer" *ngFor="let menu of usermenus"> <div class="panel panel-default col-lg-6 col-md-6 col-sm-12"> <div class="panel-heading">{{menu.Title}}</div> <div class="panel-body"> <ul class="sub" style="display: block;" *ngFor="let subMenu of menu.SubMenus"> <li><a href="#" (click)="getSubMenu(subMenu.Title)>{{subMenu.Title}}</a

Angular 2 : How do I send childComponent properties to parent when you don't know the childComponent's class?

拟墨画扇 提交于 2020-01-15 10:38:07
问题 Okay so here's what I'm trying to achieve : I have this component : import { Component, Output, EventEmitter, OnInit } from '@angular/core'; @Component({ selector: 'like', template: '<p>this is the like component<p>' }) export class LikeComponent implements OnInit{ title: string = 'Like Component'; @Output() sendTitle = new EventEmitter(); ngOnInit() { this.sendTitle.emit({title: this.title}); } } I want to send the title from it to the parent : import { Component, Input } from '@angular/core

Destroy instance of class then create instance of it again

纵饮孤独 提交于 2020-01-15 06:05:46
问题 i have a class (Class ButtonX) that contains a button when user clicks the button, it will create instance of the class DialogX when I create instance of the class DialogX it will show up JDialog public class ButtonX { public ButtonX() { JFrame me = new JFrame(); JButton n = new JButton("show dialog"); n.addActionListener(ListenerX.listen); me.getContentPane().add(n); me.pack(); me.setVisible(true); } public static void main (String[]args){ new ButtonX(); } } listener of that JButton public

Destroy instance of class then create instance of it again

こ雲淡風輕ζ 提交于 2020-01-15 06:03:12
问题 i have a class (Class ButtonX) that contains a button when user clicks the button, it will create instance of the class DialogX when I create instance of the class DialogX it will show up JDialog public class ButtonX { public ButtonX() { JFrame me = new JFrame(); JButton n = new JButton("show dialog"); n.addActionListener(ListenerX.listen); me.getContentPane().add(n); me.pack(); me.setVisible(true); } public static void main (String[]args){ new ButtonX(); } } listener of that JButton public

How to call another components methods in angular2

↘锁芯ラ 提交于 2020-01-15 05:08:12
问题 In addTo.component.ts component I have a method and constructor as follows Method: **addTo(ServicePlanId, basketSection) {......}** Constructor: **constructor( private route: ActivatedRoute, private router: Router, private addToService: addToService, private DashboardService: DashboardService) { })** Imports: import { Component, OnInit, Input, Output, EventEmitter,AfterViewInit} from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import {addToService} from './..

Validate child input components on submit with Vee-Validate and vue js 2

痴心易碎 提交于 2020-01-14 12:53:14
问题 I'm currently trying to create a Registration form with multiple "Input Field" components which all require validating once Submit has been pressed. They all currently validate on their own accord when the text within is changed but I'm finding it difficult to make a global call to all input fields to validate all. What I am trying to achieve is the following:http://vee-validate.logaretm.com/examples#validate-form yes this is simmiler to this question Validate child input components on submit

Validate child input components on submit with Vee-Validate and vue js 2

*爱你&永不变心* 提交于 2020-01-14 12:52:27
问题 I'm currently trying to create a Registration form with multiple "Input Field" components which all require validating once Submit has been pressed. They all currently validate on their own accord when the text within is changed but I'm finding it difficult to make a global call to all input fields to validate all. What I am trying to achieve is the following:http://vee-validate.logaretm.com/examples#validate-form yes this is simmiler to this question Validate child input components on submit

cakephp component $this->controller->modelClass

强颜欢笑 提交于 2020-01-14 10:37:08
问题 In Component I try to access Myprofile Model class SignMeupComponent extends Object public function register() { $this->__isLoggedIn(); if (!empty($this->controller->data)) { extract($this->settings); $model = $this->controller->modelClass; $this->controller->loadModel($model); $this->controller->{$model}->Myprofile->save($this->controller->data); $this->controller->data['Myprofile']['user_id'] = $this->controller->{$model}->id; $this->controller->{$model}->set($this->controller->data); if (

How to get the project path at Design Time

强颜欢笑 提交于 2020-01-14 09:07:30
问题 I use a component (System.ComponentModel.Component) and I want to get the application path of my project in order to create a file within it. Thx Florian 回答1: The only thing that seemed to work (consistently) for me was obtaining EnvDTE.DTE (from the IServiceProvider you get from EditValue()), i.e.: EnvDTE.DTE dte = envProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE; string dir = Path.GetDirectoryName(dte.Solution.FullName); When I tried using Assembly.GetXAssembly, I got the temporary